[M3devel] interface UserThread?

wagner at elegosoft.com wagner at elegosoft.com
Sat Mar 27 16:38:40 CET 2010


Quoting Jay K <jay.krell at cornell.edu>:

> Should we offer, say, interface UserThread?
> One could say IMPORT UserThread AS Thread.
>
> It's pretty easy, on Posix.
> Except there isn't just Thread.T exposed by the thread library.
> There is e.g. Scheduler, SchedulerPosix.

You'd like to mix those interfaces?

Let's go one step back. What we would actually like to have is
a simple switch for system and user threads, for example by just
linking against another library. This isn't possible in the current
implementation, because _everything_ would have to be recompiled, IIRC.

I'm not sure about the reason anymore though. Why can't we have all
thread-specific calls pass through one library interface? Does the
compiler need to produce different code for some calls? Is it just
too inefficient for some functions?

If we cannot achieve something simpler that would not need changing
the code, then I'd consider a new interface for user threads an option.
I don't really like it, because Thread is a standard interface of the
language, and we should be very careful to change anything there.
At least we should agree that it's worth the efforts.

Any opinions?

Olaf





More information about the M3devel mailing list