>From: Aurelien Degremont - Stagiaire <degremont@xxxxxxxxxxx>
>Dean Roehrich a écrit:
>> I don't see why there would be a problem.
>It is never say in DMAPI spec the dm_get_events() function could be used
>by different processes, using the same session id. They all will wait
>for events but:
>Which process will be wake up ?
Possibly both will be signaled. But only one will get the session lock. Only
the one that has the session lock can walk the session's event list. Only one
can look at any particular event at a time.
>If two (or more) processes are waiting on dm_get_events(), a message
>arrive but the buffer is two small (E2BIG), what happens ?
If there is an error like that, then the event will be unlocked and other
waiters in dm_get_events will be signaled so they can attempt to pick it up.
>The spec says absolutely nothing concerning this point.
>Does a document describing the choices and differents between the spec
>and the sgi implementation exist ?
There are differences, but they're accidental and ancient, and as I find them
I change the implementation to match the spec (provided I know it won't break
existing applications that we care about).
Are you actually seeing race problems with multiple threads using the same
session in dm_get_events?