[M3devel] dynamic chose between user/kernel threads?

Tony Hosking hosking at cs.purdue.edu
Thu Jan 8 03:51:15 CET 2009


Jay, perhaps you can provide some context and motivation for your  
proposals.  I am unable to evaluate your proposals in the form of a  
simple laundry-list.

On 8 Jan 2009, at 01:34, Jay wrote:

> I looked into this a bit..and I think it's actually pretty easy.
> It hardly churns the code even.
>
>
> I have other things I want to do first.
>
>
> In the meantime, specify the directive?
> There are actually a large number of subtle options.
>
>
> Can I ask for any of n libraries -- NT, pthreads, user threads?
>  setjmp vs. context? Or is it just a boolean, user vs. kernel?
>
>
> Is the option to "favor" or "require" a certain library?
>
>
> Can I set it on libraries or only programs?
>  What if the requests clash?
>
>
> Is it "Favor" or "Require"?
> Is it a function call or setting a global variable?
> I favor function call, but TARGET, WORD_SIZE, BUILD_DIR establish  
> the other precedent,
> and either can work.
>
> Is it flags in the moduleinfo like incgc, gengc, or separate data that
> there is just one of in RTLinker? Probably separate data, unless it  
> is allowed in libraries.
>
>
> What are the names of the libraries?
>  "posix" and "pthreads"  ?
>   "user" and "kernel" ?
>   "true" and "false" (or vice versa) ?
>
>
> Should NT implement user threads, using fibers?
>
>
> Presumably it works with both standalone and shared/dynamic programs.
> Presumably it is ok to always bloat up m3core.dll with both libraries.
> Presumably it is ok to have everyone pay a teeny tiny perf.
>   That is, there is a microscopic dispatching layer, that everyone
>   ends up going through, not chosing to link in one library or the  
> other.
>
>
> And as part of this, whenever it happens, can we bump up the minimum
> bootstrap to a version that includes  
> SchedulerPosix.DoesWaitPidYield()?
> Or does it become VAR Scheduler.UsingKerneThreads?
> (no, it should be a function; but naming matter remains).
>
>
> (ie. as I said, the decision currently is baked into m3core.dll, but
> now it is also baked into sysutils.dll, but these should change  
> together;
> m3core.dll should manage the knowledge).
>
>
>  - Jay
>
>
> > Date: Sat, 3 Jan 2009 01:12:27 +0100
> > From: wagner at elegosoft.com
> > To: m3devel at elegosoft.com
> > Subject: Re: [M3devel] dynamic chose between user/kernel threads?
> >
> > An option to cm3 or a quake directive to use in the m3makefiles
> > would suffice in my opinion (and be a great improvement).
> >
> > Olaf
> >
> > Quoting Jay <jay.krell at cornell.edu>:
> >
> > >
> > > Should the user/kernel thread chose be available:
> > >
> > >
> > > On the command line to a Modula-3 executable (or even an  
> executable
> > > where main is in another language, but which static or dynamic
> > > Modula-3 libs are used)?
> > >
> > >
> > > Via a quake directive when building programs?
> > >
> > >
> > > You know, imagine you have a bunch of Modula-3 programs and some  
> but
> > > not all use a very large number of threads and benefit from
> > > userthreads.
> > >
> > >
> > > Currently the chose is locked into m3core when it is built.
> > >
> > >
> > > - Jay
> >
> >
> > --
> > Olaf

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090108/e9ca0de8/attachment-0002.html>


More information about the M3devel mailing list