[prev in list] [next in list] [prev in thread] [next in thread] 

List:       9fans
Subject:    Re: [9fans] setitimer equivalent, and sigvtalarm equivalent
From:       yoann padioleau <aryx.padator () gmail ! com>
Date:       2015-05-02 18:01:11
Message-ID: A9CADAAE-5A01-41B5-9CAE-BD96C35AA480 () gmail ! com
[Download RAW message or body]

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 in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic