multithreading class [modified]
-
Hi, I need help to write a multi thread simple class, I know this should be simple but I face some difficulties, any help will be appreciated. Implementing single-write, multiple-read multi thread synchronization (using windows synchronization primitives like mutex, semaphore etc.). Thanks in advance, Eyal
modified on Saturday, October 17, 2009 7:11 AM
-
Hi, I need help to write a multi thread simple class, I know this should be simple but I face some difficulties, any help will be appreciated. Implementing single-write, multiple-read multi thread synchronization (using windows synchronization primitives like mutex, semaphore etc.). Thanks in advance, Eyal
modified on Saturday, October 17, 2009 7:11 AM
-
Hi Eyal! In what problem did you run, what have you done so far, which multithreading tutorials have you read? Have a good weekend /M
Webchat in Europe :java: (only 4K)
-
Hi, I need help to write a multi thread simple class, I know this should be simple but I face some difficulties, any help will be appreciated. Implementing single-write, multiple-read multi thread synchronization (using windows synchronization primitives like mutex, semaphore etc.). Thanks in advance, Eyal
modified on Saturday, October 17, 2009 7:11 AM
There are many ways to do this, depending on if you want to enforce a preference for readers or writers or neither. The easy way would be to assume the target system is Vista or greater and use the new SRWLOCK[^] variable. :) However, I expect the spirit of the question was to write the logic yourself. Check the following links: http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx[^] http://blogs.msdn.com/vancem/attachment/563180.ashx[^] http://www.bluebytesoftware.com/blog/2009/01/30/ASinglewordReaderwriterSpinLock.aspx[^] If you have a question about a specific implimentation then post the code you having troubles with.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack
-
There are many ways to do this, depending on if you want to enforce a preference for readers or writers or neither. The easy way would be to assume the target system is Vista or greater and use the new SRWLOCK[^] variable. :) However, I expect the spirit of the question was to write the logic yourself. Check the following links: http://blogs.msdn.com/vancem/archive/2006/03/28/563180.aspx[^] http://blogs.msdn.com/vancem/attachment/563180.ashx[^] http://www.bluebytesoftware.com/blog/2009/01/30/ASinglewordReaderwriterSpinLock.aspx[^] If you have a question about a specific implimentation then post the code you having troubles with.
...cmk The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying. - John Carmack