From: yoann padioleau <aryx.padator@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] setitimer equivalent, and sigvtalarm equivalent
Date: Sat, 2 May 2015 11:01:11 -0700 [thread overview]
Message-ID: <A9CADAAE-5A01-41B5-9CAE-BD96C35AA480@gmail.com> (raw)
In-Reply-To: <327906ef0db2d363fc57be34bfe82774@brasstown.quanstro.net>
Hi,
Yes I think you’re right. Indeed the machine has one
timer interrupt and it’s enough for the kernel to demultiplex
it over many processes who each can have different alarm
requirments.
Thx.
> On May 2, 2015, at 8:06 AM, erik quanstrom <quanstro@quanstro.net> wrote:
>
>> I’m not sure I understand your proposal.
>>
>> But looking more at the code I need to port, an interpreter, I think
>> the main issue is that the interpreter relies on sigvtalarm as
>> a way to preempt the interpreted program while allowing
>> the user program to use only sigalarm. So more generally
>> the problem is how can I have two alarms in plan9? I see only
>> one alarm signal in ape, SIGALRM. There is no SIGVTALRM.
>
> the standard way to do this is as the kernel does. the kernel typically
> keeps one highres timer (per core), and a linked list of events sorted by alarm
> time. when the alarm fires, do the action associated with each alarm that has
> passed and reload periodic timers. this is in port/portclock.c. i'm sure there
> are implementations of this algorithm elsewhere, too.
>
> - erik
>
prev parent reply other threads:[~2015-05-02 18:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 4:28 [9fans] setitimer equivalent yoann padioleau
2015-04-29 4:38 ` James A. Robinson
2015-04-29 4:55 ` lucio
2015-04-29 5:19 ` James A. Robinson
2015-04-29 6:38 ` lucio
2015-04-29 16:47 ` erik quanstrom
2015-05-01 3:21 ` [9fans] setitimer equivalent, and sigvtalarm equivalent yoann padioleau
2015-05-01 7:17 ` Skip Tavakkolian
2015-05-02 15:06 ` erik quanstrom
2015-05-02 15:27 ` cinap_lenrek
2015-05-02 18:01 ` yoann padioleau [this message]
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=A9CADAAE-5A01-41B5-9CAE-BD96C35AA480@gmail.com \
--to=aryx.padator@gmail.com \
--cc=9fans@9fans.net \
/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 NNTP newsgroup(s).