lkml.org 
[lkml]   [1999]   [Jul]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: kernel thread support - LWP's
From
Date
Tim Hockin <thockin@isunix.it.ilstu.edu> writes:

> I like it too. I'm doing it right now. Only problem is notifying the
> parent that it had a child without knowing it! (Next on Jerry Springer..)

While you are at it please also take the appended patch into accound.
It was written by Richard Henderson after my continuous whining about
missing kernel features. It is also needed to correctly start
threads. What it does is introducing a feature available in all other
kernels, namely, creating a thread which is not starting to run
immediately.

--
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- 2.1.109/include/linux/sched.h Fri Jul 17 17:59:05 1998
+++ 2.1.109-axp/include/linux/sched.h Tue Jul 21 15:05:49 1998
@@ -33,6 +33,7 @@
#define CLONE_SIGHAND 0x00000800 /* set if signal handlers shared */
#define CLONE_PID 0x00001000 /* set if pid shared */
#define CLONE_PTRACE 0x00002000 /* set if we want to let tracing continue on the child too */
+#define CLONE_SUSPENDED 0x00004000 /* create the process in the stopped state. */

/*
* These are the constant used to fake the fixed-point load-average
--- 2.1.109/kernel/fork.c Fri Jul 17 17:59:29 1998
+++ 2.1.109-axp/kernel/fork.c Tue Jul 21 15:05:49 1998
@@ -580,7 +580,11 @@
p->counter = current->counter;

if(p->pid) {
- wake_up_process(p); /* do this last, just in case */
+ /* do this last, just in case */
+ if (clone_flags & CLONE_SUSPENDED)
+ p->state = TASK_STOPPED;
+ else
+ wake_up_process(p);
} else {
p->state = TASK_RUNNING;
p->next_run = p->prev_run = p;
-
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:53    [W:0.050 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site