lkml.org 
[lkml]   [2000]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Slow pthread_create() under high load
On Tue, 28 Mar 2000, Stephen C. Tweedie wrote:

> Hi,
>
> On Tue, Mar 28, 2000 at 05:07:44AM -0500, Albert D. Cahalan wrote:
> >
> > Stephen C. Tweedie:
> > > Maybe, but although a lot of the POSIX threads are reasonable,
> > > things like requiring uid/gid updates to be instantly effective
> > > across all threads in the process are just insane.
>
> > If we had a task-group notion in the kernel, we could send some
> > sort of signal to all tasks in the group.
>
> You can do that anyway, in user space. Much cleaner.

Sure you can, but the trick is to send one (1) signal to a group of tasks.
Not n times the same signal to n tasks. IMHO, the POSIX semantics of
signal delivery require a shared signal queue and a private queue. The
shared signal queue is used for signals which are sent to the "process" as
a whole (translate to a group of cloned tasks in Linux) and the private
queue is use for signals sent to an individual thread (translate to one
task of a group of cloned tasks in Linux).
I have implemented a shared signal queue implementation which is triggered
by yet another CLONE_* flag. It seems to work, although I would like some
people to have a look at it.
I feel that this behaviour should be optional. It is useful under certain
circumstances, but it may hurt performance in other cases. For instance,
it could be useful in the situation where signals are used to notify a
group of threads of incoming data on a huge number of sockets. This should
fix the problem noted in the past with the bad performance of select/poll
when handling huge amounts of file descriptors.
On the other hand the shared signal queue introduces inter-thread
dependencies which might hurt certain real-time applications. A lock on
the shared signal queue is needed to prevent two threads simultaneously
accessing the signal queue. This might introduce unwanted delays.

My shared signal queue patch can be found at:
http://www.rhdv.cistron.nl/sigqueue.html

Robert

--
Robert de Vries
rhdv@rhdv.cistron.nl


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.049 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site