thanks, If this function works the thread wouldn't need any semaphore. I could even spawn it from python, which would be cleaner
Maybe this function NMLTYPE blocking_read_extended(double timeout, double poll_interval); from nml.hh could do a clean job I'll investigate further Many thanks On July 31, 2009 08:00:02 pm Frank Tkalcevic wrote: > According the documentation > http://www.isd.mel.nist.gov/projects/rcslib/NMLcpp.html there is a > blocking_read() function that internally waits until it is signalled that > there is a message to be read. You can either look into the blocking_read > implementation to see if the events/fds are exposed, or set up your own > background thread to do wait. > > Frank > > > _____ > > From: Maxime Lemonnier [mailto:maxime.lemonn...@gmail.com] > Sent: Saturday, 1 August 2009 8:37 AM > To: EMC developers > Subject: [Emc-developers] RCS/CMS/NML question > > > Hi, > > > > > > I'm looking for someone familiar enough with the RCS/CMS/NML subsystem. > > > > > > I'm looking for a way to implement the observer pattern so, what I'd need > is a way to register some callback function(s) when shared memory is > written. > > > > > > > > > This is where I'm starting from : > > > > > > [17:54] <alex_joni> in cms/cms_in.cc > [17:55] <alex_joni> you can probably (somehow) add your callback there > [17:55] <alex_joni> the write_raw gets called when a new function gets > written to the unbuffered channel > [17:55] <alex_joni> and queue_write_raw gets called for buffered channels > > > > > > It appears that the > > > > > > CMS_STATUS CMS::write_XXX > > > > > > family of function would be the right places to add a callbacks queue, but > I still don't know what to do with queued writes, I'll continue to > investigate. Also, I'm looking for a good place in the server to execute my > callbacks, when idle for instance. I don't want the write function to wait > for my callback to return, which would slow down the server. > > > > > > At worst I'll spawn a thread, but that means semaphores, so I'd rather used > an existing facility. > > > > > > Any other input would be welcome > > > > > > Thank you, > > > > > > (I'm still working on a PyQ4t-based gui project, it is going on well, but > poll-based refresh is a no go for a project which main intent is a cleaner > design.) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers