The Producer/Consumer architecture allows us to provide provisions for thread cooperation, and exchanging values between threads in a safe manner. As recommended by Dr. Schreiner, we created a producer/consumer "cell" that has the thread safe locking mechanisms built into it. This affords us a few advantages:
1. Cleans the code up so that we don't need to have the locking mechanisms in every place that the pattern is to be used.
2. Reduces the tendency for error as the code does not have to be duplicated in each instance
Multiple instance of the cell can be created, else a since cell
This represents a very important design pattern for the cooperation of threads, and should be something that is committed to memory.
See these additional links for more information:
http://social.msdn.microsoft.com/Forums/en-US/vblanguage/thread/b4d97184-17e8-4b6c-b038-38eb4dee49fc
http://zone.ni.com/wv/app/doc/p/id/wv-1295
No comments:
Post a Comment