mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: sounak chakraborty <sounakrin@yahoo.co.in>
To: Jan Engelhardt <jengelh@linux01.gwdg.de>,
	linux kernel <linux-kernel@vger.kernel.org>
Subject: Re: sched.c  function
Date: Thu, 24 Mar 2005 11:03:21 +0000 (GMT)	[thread overview]
Message-ID: <20050324110321.83788.qmail@web53308.mail.yahoo.com> (raw)
In-Reply-To: 6667



> Tasks do not change their state without holding a
> lock. (There is an exception,
> but it is justified.)
list after that..
> 
> So you want to record task state changes? That is
> better done at the right
> places in the kernel rather than traversing the task
> list repeatedly (the
> latter is not that performant).

So you want to say that only one task could be running
at a single time 

but how to know which one 
is there any way without traversing the task list
previously i thought of for_each_process(p)
                        if(p->state==running)

but without this how to find which process is
currently running and other are sleeping 
may it is through "current"

since the current->pid is only running
but i have to run this repeatedly to get the
information of currently running process(since this
may be for a fraction of a second and i can miss that
process if my loop is longer) 
how to do that 
fast timer 
or any other way 
i am little bit confused
                        

> I would be interested in the background: what do you
> need to know the task
> states for?


i want to develop a task manager for threads.
the application reads properly the process information
and the thread information but not able to refresh the
thread information as i am building my own proc file
where only threads are there 
i am distinguishing between process and thread at
fork.c
with clone_vm set..

therefore i need to know which thread is currently
running or not 


there is another problem i am discusing with you 

i want to distinguish between thread and process and
after distinguishing between user thread and kernel
thread 
but i am unable to find any condition which will be
true for kernel level thread during creation and false
for user level thread 
can you help me in this also
thanks 
sounak

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

             reply	other threads:[~2005-03-24 11:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-24 11:03 sounak chakraborty [this message]
2005-03-24 12:06 ` Jan Engelhardt
2005-03-24 16:40   ` Lee Revell
  -- strict thread matches above, loose matches on Subject: below --
2005-03-24  9:33 sounak chakraborty
2005-03-24  9:42 ` Jan Engelhardt
2005-03-24  4:43 sounak chakraborty
2005-03-24  7:00 ` Jan Engelhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050324110321.83788.qmail@web53308.mail.yahoo.com \
    --to=sounakrin@yahoo.co.in \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome