mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* problem with process and threads
@ 2005-03-18 10:49 sounak chakraborty
  0 siblings, 0 replies; only message in thread
From: sounak chakraborty @ 2005-03-18 10:49 UTC (permalink / raw)
  To: linux kernel

  
dear sir
    The number of processes that are being created in
fork.c() in function do_fork are less than the  number
of processes are being terminated in exit.c in
function do_exit().
    I am placing a printk() in both the above
functions do_fork() and do_exit() and thus after
compiling and then restarting i am getting exit
messages of many process ids that have not yet been
formed.


    Another question is that while we are using an AND
operation to distinguish between a process and a
thread (
    if(p->flags & CLONE_VM)
 in fork.c in function do_fork() in linux kernel 2.6.8
).

    But if i use the above check in do_exit() , will
it be able to distinguish between a thread and a
process in the same manner as do_fork().
    If this is not the case , then plz tell where i am
wrong and rectify my mistake.

    One more problem is while p->active_mm is equal to
NULL in case of kernel threads and not NULL in case of
user level threads ; through this check we can
identify kernel and user level threads in fork.c but
in exit.c the same p->active_mm value is not NULL for
kernel and user level threads.
   Hence i want to know how can i make a distinction
between kernel and user threads . Is there any other
way?

 Eagerly waiting for a reply,
 Thanks in advance,
 Sounak    


________________________________________________________________________
Yahoo! India Matrimony: Find your partner online. http://yahoo.shaadi.com/india-matrimony/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-03-18 10:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-18 10:49 problem with process and threads sounak chakraborty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®