Hi!
> > Apart from that the logic looks fine. The test could be probably cleaned
> > by using checkpoints instead of pipe and the function used to propagate
> > exit value from child, but that is probably worth of separate patch.
> 
> Checkpoint alone doesn't seem to be enough to tell difference between:
> - child has read one record and will continue reading
> - child read has reached eof and will now exit
> 
> while parent does:
> do {
>   ret = tst_checkpoint_wait()
> } while (ret == 0)
> 
> I could map some shared memory for such flag, but I'm thinking if I can't just
> use tst_futexes to store such flag. In that case, it would likely be
> needed to handle EWOULDBLOCK in tst_checkpoint_wait and restart wait.

Hmm, we can change the tst_checkpoint library to allocate two uint32_t
per id (even would be for futex and odd for the propagated value) and
add parameters to propagate 32bit integer value from
tst_checkpoint_wake() to tst_checkpoint_wait(). That way we would avoid
the need for changing the futex related code at all (the only change
would be id -> 2 * id). Given that we allocate whole page we can waste
half of the checkpoint pairs without any problems.

-- 
Cyril Hrubis
chru...@suse.cz

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to