compact framework - Is there a good Semaphore for XNA on the XBox 360? -


I am looking for a fast and efficient implementation of the semaphore for the .NET Compact Framework. Here is another question which is in SO (), which was suggested to use P / AA, but it is not possible in the XNA framework running on XBex 360.

I can offer my two implementations

(PestBin)
A possible implementation of a managed Samphor, using an autosetset Will happen.

P> In this case, when the work becomes available, AutoResetEvent will only transfer one thread to the 'Runable' state. When the OS Thread Scheduler runs the thread, it will reopen AutoResetEvent, the next thread will be brought to 'Runable' status. Then threads will start sequentially, and their predecessors will actually come only after execution.

(PestBin)
Another possible implementation will use a manual RSSSet event.

In this case, when the work is available, the manual rasetset will move all the threads to the 'Runable' position. OS thread scheduler competes for all thread work items, unless the first thread which exits from work, resets the manual reset event again. In other words, maybe all threads will wake up for a short time, even if all the threads are not needed.

Does anyone know about better implementation or can provide suggestions for my improvement?

Edit: Never, just read another thread you referenced: Not only the semaphore class is included in the Xbox CF?

Otherwise, here is an implementation that I found on CodeProject. It has not used it yourself, but it might work as a reference :-)


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -