Re: [LTP] Add easy to use API for parent-child synchronization.

chrubis
2012-12-13T14:19:54Z

Hi!
> am I reading it correctly, that you can only use it for single
> parent and child pair because the pipe name is pre-defined?

There is only one hardcoded pipe to keep the interface simple as I
haven't found testcase that would require more that this (that doesn't
mean there is none).

> Could be name of the pipe passed in tst_checkpoint_init()?
> The testcase I have in mind is 'waitid02' which spawns multiple children.

That shouldn't be a problem as far as you don't need to distinguish
between the childrens. Just call TST_CHECKPOINT_PARENT_WAIT() the number
of children you need to to wait for and it should work.

Each children would then write exactly one character to the fifo once
it's ready and the parent would wait until all childrens signaled that
they are ready.

Or even better we can easily create second version of parent wait that
would have number of children as an argument.

If you need something more complicated (i.e. synchronize several
childrens and parent) we can easily add filename parameter to the
checkpoint init and default to the current behavior if NULL is passed.

--
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net