Strawman proposal: making libthr default thread implementation?

Daniel Eischen deischen at freebsd.org
Mon Jul 3 12:29:22 UTC 2006


On Mon, 3 Jul 2006, David Xu wrote:

> On Monday 03 July 2006 19:48, Daniel Eischen wrote:
>
>> Yes, you have to support PTHREAD_PRIO_PROTECT, PTHREAD_PRIO_INHERIT
>> mutexes, and SCHED_RR, SCHED_FIFO, and SCHED_SPORADIC scheduling
>> (hopefully not under the restriction that you are a privileged user).
>>
>
> I would tell you don't implement system scope thread in libpthread,
> because system scope thread does not work in the way you said here,
> it seems you are telling user that the libpthread is fully working in
> the way, but the reality is not, without a correct kernel support,
> I don't think you should introduce system scope thread into libpthread,
> please remove this feautre if you think libpthread should work in the way.

I don't believe that system scope threads have to abide
by SCHED_RR, SCHED_FIFO, and SCHED_SPORADIC scheduling
since their contention scope is different.

> but reality is, mysql is using system scope in libpthread to get better
> performance but not process scope thread. in the real world, these
> nominal features are also not used widely, using it can only cause
> serious performance problem in most applications, until you need hard
> realtime, but why do you use FreeBSD if you need hard realtime ?
> there are dedicated systems which are designed for this requirement.
> I still does not find an application really need this feature. Also
> I don't think one can easily implement a modern CPU friendly scheduler
> in userland, HTT, shared L2 dual-core, NUMA scheduling, doing it in kernel is
> already extreme diffcult, putting lots of effort in single library but other
> single threaded application still gain nothing is also not worthy to work
> on M:N thread library.

This has no impact on libpthread.  The KSE is the thing
that the kernel knows about and it can keep threads running
on the same KSE and assign KSEs to different CPUs, etc.
All the threads library has to do is keep threads running
on the same KSE.  I've said this before, but you keep
making the same argument ;-)

>> If you can those in libthr, I have no objection.  However, these
>> are not as easy to do in 1:1.
>
> it depends on whether one has interest to implement it, nothing
> is impossible here, kernel has already turnstile code, this already
> made a bit forward.

Are you going to do it?

-- 
DE


More information about the freebsd-threads mailing list