9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] waitpid()
@ 2004-04-16  8:04 lucio
  2004-04-16  8:54 ` Fco.J.Ballesteros
  2004-04-16 11:36 ` boyd, rounin
  0 siblings, 2 replies; 12+ messages in thread
From: lucio @ 2004-04-16  8:04 UTC (permalink / raw)
  To: 9fans

Posix waitpid() seemingly can select the PID to wait for.  Unlike P9
waitpid(2) which merely returns the PID.

It has always baffled me that originally Unix allowed one to wait for
a child to complete without providing a mechanism to select _which_
child.  In other words, I side with Posix on this issue but I would be
curious to know why what seems obvious to me (in hindsight of course)
was not the design in the first place.

Of some importance is the fact that the current APE implementation has
an understandably faulty waitpid(): it removes PIDs it does not (yet)
care about while looking from the requested one.  When one later goes
looking for one of these discarded PIDs, it naturally does not get
found.

It is unmanageable to cache PIDs somehow within APE wait model,
because it is difficult (unless I miss something) if not impossible to
track PID as children terminate, so they can be added to the cache by
the time a process comes looking for them.

So the big question is whether it is entirely out of the question to
enhance the kernel "wait" functionality so that something resembling
Posix waitpid() can return the termination information for a chosen
PID.

I have not looked at the kernel myself, but until the historical
reasons have been shown to be insignificant, I'm not the best person
to investigate this.

++L




^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-04-19  6:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-16  8:04 [9fans] waitpid() lucio
2004-04-16  8:54 ` Fco.J.Ballesteros
2004-04-16  9:03   ` lucio
2004-04-16 11:10     ` Fco.J.Ballesteros
2004-04-16  9:07   ` lucio
2004-04-16  9:12     ` lucio
2004-04-16 11:36 ` boyd, rounin
2004-04-16 11:46   ` lucio
2004-04-16 12:01     ` boyd, rounin
2004-04-16 16:47       ` lucio
2004-04-16 17:10         ` boyd, rounin
2004-04-19  6:30           ` lucio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).