Hi! > I thought we had this issue only in parent: > > --------------------------------------------------------------------------------------------------- > parent | child > | tst_checkpoint_child_wait > | - has to wait until parent > opens pipe for write > tst_checkpoint_signal_child (NONBLOCK write) | > tst_checkpoint_parent_wait (NONBLOCK read) | > - parent now races on read with child | > --------------------------------------------------------------------------------------------------- > > because child is opening always in blocking mode, it will always wait until > other > side is opened as well: > --------------------------------------------------------------------------------------------------- > parent | child > | tst_checkpoint_signal_parent > | - has to wait until parent > opens pipe for read > tst_checkpoint_parent_wait (NONBLOCK read) | > - reads from FIFO | > | tst_checkpoint_child_wait > | - has to wait until parent > opens pipe for write > tst_checkpoint_signal_child (NONBLOCK write) | > - at this point first byte was already read | > from FIFO, parent writes second byte | > | - and only now will child > succeed opening pipe > --------------------------------------------------------------------------------------------------- > > Am I missing something?
You are right. The problem here is that the fifo can be opened for NONBLOCK reading even if there are no writers and therefore there are two readers that fight for the data in the fifo. The second ordering should be fine as far as I can tell. -- Cyril Hrubis chru...@suse.cz ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://p.sf.net/sfu/Zoho _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list