lkml.org 
[lkml]   [1998]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Thread implementations...

On 23 Jun 1998, David Wragg wrote:

> Last night I added a small amount of kernel support, so that I can
> modify LinuxThreads for direct thread creation and find out what the
> improvements to pthread_create might actually be.

cool!

> A CLONE_MINOR flag to clone creates a /minor process/. When a minor
> process clones/forks a new process, the parent of the new process is
> the parent of the minor process, rather than the minor process
> itself. So by using CLONE_MINOR, all the threads become child
> processes of the initial process.

wondering, just to stay in line with other CLONE_ flags, wether we should
call this 'CLONE_PPID'. This is just yet another 'splitup' of thread
properties, and makes it possible to share ppid. It might also make sense
to really share this info just like say signal structures are shared. It
adds _some_ overhead to access p->ppid (we'd have to access p->pid->ppid),
but it's more streamlined with the original clone() concepts. It also
makes guarantees that whenever the manager thread dies unexpectedly, the
kernel can link all 'orphans' to the manager thread's parent properly, so
the pid tree never gets out of sync.

> The changes to the kernel are tiny, it fixes one problem nicely, and
> doesn't seem to create any new ones.

this is really cool. Have you measured the performance of pthread_create()
before and after this change? Another thing i noticed in LinuxThreads is
is the 'manager pipe' communication overhead, is this still is present?
Not sure how this could be avoided though :(

also, wondering wether LinuxThreads could just use the same trick the
kernel uses to access the 'current' thread, by doing %%esp & ~-8192 to
access to 'start' of the kernel stack, there one could store the thread
structure? [hm, not sure wether this works for LinuxThreads, in the kernel
we can guarantee that the kernel stack is 8K aligned]

-- mingo


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:43    [from the cache]
©2003-2011 Jasper Spaans