[M3devel] FW: variations of waitpid..?

Jay jay.krell at cornell.edu
Thu Jan 1 02:59:50 CET 2009


[truncated just slightly..and probably will be again given more rambling..]
 
ps: the internal use in m3core could be easily removed, just by compiling one branch of the if or the other.
I just wanted them in the same file to keep similar code closer together.
 
So it comes down that m3core does expose Uwaitpid.waitpid and Uexec.waitpid, and as long as they are...or as long as user threads exist..imho there is some obligation of m3core to expose perhaps surprising characteristics of its thread library. You might say the entire interface is already and has always been fully exposed in Thread.i3, but I don't believe it. User threads and kernel threads have too divergent too visible artifacts, that I don't think are previously exposed in the public interface.
 
I claim it is somewhat "surprising", or at least important to know the detail of, whether or not waitpid yields to other threads.
 
You know, I mean..let's say I am some really clever waitpid user and I really must use it. And I am using Modula-3 threads. And my child process is reading the output of Modula-3 threads. Aren't I kind of stuck? Isn't there /some/ obligation of m3core to help just a teeny tiny bit? Or, would you argue, I am obligated, if I am using Modula-3, to use the higher level interfaces, that already know about this? Well, ok, m3core did already know about, I fixed it only a few months ago, but then even the likes of sysutils is stuck?
 
Another example, that may or may not be well exposed, is willingness/ability to set thread stack size. Mika mentions creation thousands of threads. 32bit kernel threads are going to be more limited here. Whereas 32bit user threads might be willing to create much smaller stacks, and 64 bit anything has essentially infinite address space for infinite stacks (but still beware working set, physical memory is not infinite).
 
(Personally I have seen precious little code that cares about stack size, just seems to somehow get along, combined with the fact that the current Modula-3 pthread code very likely leaks on some platforms attempting to deal with stack size, makes me inclined to just rip out the code..but yeah..just fix the leak...)
 
 - Jay



From: jay.krell at cornell.eduTo: hosking at cs.purdue.eduCC: mika at async.caltech.edu; m3devel at elegosoft.comSubject: RE: [M3devel] variations of waitpid..?Date: Thu, 1 Jan 2009 01:49:28 +0000

 > If someone uses waitpid they get what they paid for.  But someone is us -- m3core/libm3 (I think just m3core), sysutils, and then cm3 uses them. I guess there is a point that this "grand new interface" SchedulerPosix.DoesWaitPidYield has precious few users. (It isn't grand. It takes no parameters and just returns a boolean, hardcoded, depending on thread library.) m3core now (today) uses it internally -- no need for a public interface.Sysutils can't use it until the baseline m3core is newer, so arguably, not a user.  Instead (today) sysutils uses m3core's m3makefiles to decide the value. Heck, waitpid is therefore only used internally by m3core, and sysutils.If sysutils could be (partly) merged into m3core, then m3core's waitpid need not be public.  - Jay> CC: mika> From: hosking> To: jay> Subject: Re: [M3devel] variations of waitpid..?> Date: Thu, 1 Jan 2009 12:29:24 +1100> > If someone uses waitpid they get what they paid for.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090101/dac29173/attachment-0002.html>


More information about the M3devel mailing list