Hi there,
After looking in Pike thread sources it seems that there is a void thread_set_concurrency(int concurrency) function but it is not used because of that:
/* SIGH! No setconcurrency in posix threads. This is more or less * needed to make usable multi-threaded programs on solaris machines * with only one CPU. Otherwise, only systemcalls are actually * threaded. */ #define th_setconcurrency(X)
Do you know what this function was for ? Why it is not available ?
More generally is it possible to add an option in thread_create for the same as pthread_attr_setschedparam() ?
In the last episode (Oct 08), David Gourdelier said:
After looking in Pike thread sources it seems that there is a void thread_set_concurrency(int concurrency) function but it is not used because of that:
/* SIGH! No setconcurrency in posix threads. This is more or less
- needed to make usable multi-threaded programs on solaris machines
- with only one CPU. Otherwise, only systemcalls are actually
- threaded.
*/ #define th_setconcurrency(X)
Do you know what this function was for ? Why it is not available ?
Posix threads does have pthread_setconcurrency(), so that comment is a bit outdated. In addition, Solaris 9 always attaches each thread to a LWP, so in effect the concurrency = Inf.
http://docs.sun.com/db/doc/806-6867/6jfpgdcnc?a=view#attrib-28
Linux also has effectively an infinite concurrency level since there's no difference between kernel and user level threads there. At least not in the traditional linuxthreads library; I know there's been talk about changing that in NPTL (or was it NGPT).
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-08 17:57: Subject: Re: Thread question
In the last episode (Oct 08), David Gourdelier said:
After looking in Pike thread sources it seems that there is a void thread_set_concurrency(int concurrency) function but it is not used because of that:
/* SIGH! No setconcurrency in posix threads. This is more or less
- needed to make usable multi-threaded programs on solaris machines
- with only one CPU. Otherwise, only systemcalls are actually
- threaded.
*/ #define th_setconcurrency(X)
Do you know what this function was for ? Why it is not available ?
Posix threads does have pthread_setconcurrency(), so that comment is a bit outdated. In addition, Solaris 9 always attaches each thread to a LWP, so in effect the concurrency = Inf.
http://docs.sun.com/db/doc/806-6867/6jfpgdcnc?a=view#attrib-28
-- Dan Nelson dnelson@allantgroup.com
/ Brevbäraren
Afaics it's used to tune the number of kernel threads in systems with two layers of threads, i.e. where the user level threads are distributed among a smaller set of kernel level threads which are those that are known by the scheduler in the kernel. Not all thread libraries have this architecture, at least not visibly in the interface.
The effect is that a higher concurrency level makes more threads that are in a runnable state known to the kernel scheduler. That might cause it to preempt more often (at least the manpage for thr_setconcurrency on Solaris implies that), but it's really up to how the scheduler works.
This has nothing to do with pthread_attr_setschedparam. That function affects real time scheduling. It would be pointless to have an interface for it in thread_create since no pike level thread can be a real time thread due to the interpreter lock.
/ Martin Stjernholm, Roxen IS
Previous text:
2003-10-08 16:04: Subject: Thread question
Hi there,
After looking in Pike thread sources it seems that there is a void thread_set_concurrency(int concurrency) function but it is not used because of that:
/* SIGH! No setconcurrency in posix threads. This is more or less
- needed to make usable multi-threaded programs on solaris machines
- with only one CPU. Otherwise, only systemcalls are actually
- threaded.
*/ #define th_setconcurrency(X)
Do you know what this function was for ? Why it is not available ?
More generally is it possible to add an option in thread_create for the same as pthread_attr_setschedparam() ?
-- David Gourdelier
/ Brevbäraren
pike-devel@lists.lysator.liu.se