E
Elisa
Hi,
Imagine I have an app with 5 threads (A, B, C, D and E). They all need
access to the same method, MyMethod(), which has the following signature:
Public Sub MyMethod()
myMutex.WaitOne()
Try
' Do stuff here
Finally
myMutex.ReleaseMutex()
End Try
End Sub
When the app runs, a thread, let's say thread A, hits MyMethod() first,
and signals the Mutex. Now the other threads one by one hit MyMethod(),
let's say in order B, C, D and E, and block on the signaled Mutex.
My question is: do I have any guarantee that the Mutex will be released
to the threads, in the same order that the threads originally noticed
the signaled Mutex? Or do all threads have an equal change of reaching
the reseted Mutex first?
E.g. if the threads enter myMethod() in order A-E, will the threads step
through myMethod() in the same order?
Regards,
Elisa
Imagine I have an app with 5 threads (A, B, C, D and E). They all need
access to the same method, MyMethod(), which has the following signature:
Public Sub MyMethod()
myMutex.WaitOne()
Try
' Do stuff here
Finally
myMutex.ReleaseMutex()
End Try
End Sub
When the app runs, a thread, let's say thread A, hits MyMethod() first,
and signals the Mutex. Now the other threads one by one hit MyMethod(),
let's say in order B, C, D and E, and block on the signaled Mutex.
My question is: do I have any guarantee that the Mutex will be released
to the threads, in the same order that the threads originally noticed
the signaled Mutex? Or do all threads have an equal change of reaching
the reseted Mutex first?
E.g. if the threads enter myMethod() in order A-E, will the threads step
through myMethod() in the same order?
Regards,
Elisa