05-09-2008 11:52 AM
05-09-2008 12:01 PM - edited 05-09-2008 12:02 PM
05-09-2008 12:07 PM - edited 05-09-2008 12:09 PM
When analyzing my design and deciding what mechanism I should use interprocess communications, I will look for the pattern "One or many writters but only one reader" as an indication that a queue can be used. Please let me suggest that you just use two queues and save yourself a lot of headaches and work. This will let the queues just be queues and will also allow the two consumers to run at completely different rates.
Ben
BUt maybe we should wait fro Raven Fan to reply to see what he thinks.05-09-2008 12:08 PM
05-12-2008 11:44 AM - edited 05-12-2008 11:50 AM
Thanks for the suggestions guys. Things are getting cluttered, so I was hoping the single writer queue would help to streamline the code a little, and some of the discussions I found on here made it sound like I would not have any trouble. But if there is any possibility for a race condition, then I will remove the chance and just use two.
As far as the preview, it still seems like one loop could remove the element before the other has an opportunity to preview it. It is safe to remove the element only after both have read it. As far as how I know when that has happened .... the evaluation loop is looking for a short burst in a huge subset, if it missed that particular signal, I would know (and it would be very bad), otherwise, I don't know when either of the loops has processed the data until everything is done and I open the files.
05-12-2008 12:03 PM
05-12-2008 12:07 PM
05-12-2008 12:10 PM - edited 05-12-2008 12:11 PM
05-12-2008 12:13 PM - edited 05-12-2008 12:13 PM
05-12-2008 12:36 PM