07-13-2005 08:19 AM
07-19-2005 06:29 AM
Hello Uwe
I have found this link:
http://digital.ni.com/public.nsf/websearch/D62D6D6DDA4BBAD386256C41005A43AF?OpenDocument
Hope this helps
Manuel
07-19-2005 08:29 AM
Manuel's KB seems to have answered most of your question. However, I would like to point one thing out. In addition to the order in which semaphore requests were served, you were asking about timing out and retrying. I'm fairly certain that when a semaphore times out, its request is removed from the semaphore request queue (otherwise you would have requests for semaphores that might not be waiting anymore). Therefore, if a semaphore times out and you restart it, it will get bumped to the back of the line. Probability is going to protect you from having semaphores starve in this way as long as
A. The semaphores all have the same timeout values and restart logic. If one of the semaphores timed out faster than the others it would be more likely to starve as it would be getting bumped to the back of the line more often.
B. You use relatively long timeouts for your semaphores. The shorter the timeout period, the more random the semaphore allocation is going to be, and the higher the probability of a thread getting starved.
Hope that helps,
Ryan K.