The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: "Frantisek Rysanek" <Frantisek.Rysanek@post.cz>
Cc: linux-kernel@vger.kernel.org
Subject: Re: setitimer vs. threads: SIGALRM returned to which thread? (process master or individual child)
Date: Sun, 11 Apr 2010 22:56:39 +0200	[thread overview]
Message-ID: <87d3y5btdk.fsf@basil.nowhere.org> (raw)
In-Reply-To: <4BBFA0C6.2610.2C4FFE@Frantisek.Rysanek.post.cz> (Frantisek Rysanek's message of "Fri, 09 Apr 2010 21:48:54 +0200")

"Frantisek Rysanek" <Frantisek.Rysanek@post.cz> writes:

> Yes, it used to be quite a relief to have Linux do the management of 
> timers for me. Now I have two options to choose from:
> 1) write my own "timer queueing" (timekeeping) code to order the 
> timers for me in the master thread
> 2) find another function, similar to setitimer(), that would function 
> the way setitimer() used to work in the old days...

POSIX timers (timer_create et.al.) allow specifying the signal.

So if you use custom RT signals for each threads and block them in the
threads you don't want them it should work. This would limit the
maximum number of threads though because there's only a limited
range of RT signals.

There are probably other ways to do this too, e.g. with some clever
use of timerfd_create in recent kernels.

Or you could overwrite the clone in the thread library to not 
set signal sharing semantics. This might have other bad side effects
though.

-Andi

-- 
ak@linux.intel.com -- Speaking for myself only.

  parent reply	other threads:[~2010-04-11 20:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-09 19:48 setitimer vs. threads: SIGALRM returned to which thread? (process master or individual child) Frantisek Rysanek
     [not found] ` <4BBF9B8F.3030106@gmail.com>
2010-04-10  7:26   ` Frantisek Rysanek
2010-04-11 20:56 ` Andi Kleen [this message]
2010-04-11 21:52   ` Davide Libenzi
2010-04-11 22:09   ` Thomas Gleixner
2010-10-17 20:42     ` Frantisek Rysanek

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=87d3y5btdk.fsf@basil.nowhere.org \
    --to=andi@firstfloor.org \
    --cc=Frantisek.Rysanek@post.cz \
    --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