LKML Archive mirror
 help / color / mirror / Atom feed
From: Bernd Petrovitsch <bernd@firmix.at>
To: Xu Yang <risingsunxy@googlemail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: looking for a function
Date: Tue, 16 Sep 2008 16:00:32 +0200	[thread overview]
Message-ID: <1221573632.6103.83.camel@spike.firmix.at> (raw)
In-Reply-To: <ab40e9c0809160550q411507aeledae30a9f835d09d@mail.gmail.com>

Hi!

On Tue, 2008-09-16 at 14:50 +0200, Xu Yang wrote:
> Hi guys,
> 
> I am looking for a function that can show me the current thread is
> running on which cpu.

> e.g I am using pthread to write a multithreaded program, in each
> thread I would like to insert such kind of function so that I can know
> on which cpu this thread is running on.

That doesn't make much sense as the same thread can run on a different
CPU after each scheduling decision. And - as it is in userspace -
scheduling can happen before any assembler op.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services



  reply	other threads:[~2008-09-16 14:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 12:50 looking for a function Xu Yang
2008-09-16 14:00 ` Bernd Petrovitsch [this message]
2008-09-16 14:11   ` Xu Yang
2008-09-16 14:18     ` Arjan van de Ven
2008-09-16 14:32       ` Xu Yang
2008-09-16 14:29     ` Frédéric Weisbecker
2008-09-16 14:33       ` Xu Yang
2008-09-16 19:04     ` Chris Snook

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=1221573632.6103.83.camel@spike.firmix.at \
    --to=bernd@firmix.at \
    --cc=linux-kernel@vger.kernel.org \
    --cc=risingsunxy@googlemail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).