Yep, this is what I meant by the Mutex operation. A mutex is traditionally
just a binary semaphore (the implementation you chose). I do the same
thing in a lot of my projects (a scope controlled mutex). Thanks for the
example!
On Sat, Aug 4, 2018 at 8:59 AM, Björn Lundin <[email protected]> wrote:
> On 2018-08-04 04:03, Jeremiah Breeden wrote:
>
> Ok, with that in mind, the current set of loops are not being done
> atomically (it is not done inside a protected operation). So the next
> question is how do we get to where they are done in a more atomic manner.
> I started off with a mutex like implementation for the close loop.since the
> close procedure could potentially block (and thus could not go in a
> protected operation). That wouldn't work for the ping loop without
> restructuring the ping procedure itself (and pull out the deletions to be
> done afterwards as mentioned in an earlier email/post).
>
> At work, we sometimes (when tasking) use the pattern below.
>
> At the end there is a client package with procedures A and B which both
>
> may affect the same resourse.
>
> But both start with grabbing a common semaphore which
>
> will be autmatically released when out of scoope.
>
> This way we use the same protected object but with no blocking operations
> in it.
>
> But this is perhaps what you meant with mutex operation?
>
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gnoga-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gnoga-list