From: Andi Kleen <ak@suse.de>
To: Jim Houston <jim.houston@attbi.com>
Cc: Andi Kleen <ak@suse.de>, linux-kernel@vger.kernel.org
Subject: Re: POSIX clocks & timers - more choices
Date: Sun, 20 Oct 2002 05:49:25 +0200 [thread overview]
Message-ID: <20021020054924.A30135@wotan.suse.de> (raw)
In-Reply-To: <3DB0FE5B.5BAA2BDB@attbi.com>
On Sat, Oct 19, 2002 at 02:40:27AM -0400, Jim Houston wrote:
> > > +{
> > > + if (p->ary[bit] && p->ary[bit]->bitmap == (typeof(p->bitmap))-1)
> >
> > Without bitfield this would look much less weird.
> >
> > I would recommend using the bitops.h primitives for such stuff anyways.
>
> I will. This does look wierd, is this my code?
The typeof() cast looks weird. I had to think twice to make sense of it.
> Good point. It looks like find_task_by_pid() needs to be protected
> by a read_lock(&tasklist_lock). The timers are linked into
> a list so they will be removed when the process exits.
> Any sugestions on a code example that does this right are
> welcome:-)
/proc does it by increasing the count in the struct page of the stack
page of the process. exit() knows about that. Example is somewhere in fs/proc/
The increase has to be done inside the lock. As always one has to be careful
with lock ordering.
The standard way is to just hold the read lock of the tasklist.
-Andi
next prev parent reply other threads:[~2002-10-20 3:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200210190252.g9J2quf16153@linux.local.suse.lists.linux.kernel>
2002-10-19 3:34 ` POSIX clocks & timers - more choices Andi Kleen
2002-10-19 6:40 ` Jim Houston
2002-10-20 3:49 ` Andi Kleen [this message]
2002-10-19 6:59 ` george anzinger
2002-10-20 3:50 ` Andi Kleen
2002-10-20 5:40 Jim Houston
-- strict thread matches above, loose matches on Subject: below --
2002-10-19 2:52 Jim Houston
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=20021020054924.A30135@wotan.suse.de \
--to=ak@suse.de \
--cc=jim.houston@attbi.com \
--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