From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sat, 2 May 2015 08:06:56 -0700 To: 9fans@9fans.net Message-ID: <327906ef0db2d363fc57be34bfe82774@brasstown.quanstro.net> In-Reply-To: <32E4BD35-FCDC-4859-9034-82747001C411@gmail.com> References: <4A54E518-87FB-4F82-84AA-BDCBD4DB0956@gmail.com> <32E4BD35-FCDC-4859-9034-82747001C411@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] setitimer equivalent, and sigvtalarm equivalent Topicbox-Message-UUID: 4ebd64e4-ead9-11e9-9d60-3106f5b1d025 > I=E2=80=99m not sure I understand your proposal. >=20 > 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 tha= t has passed and reload periodic timers. this is in port/portclock.c. i'm sur= e there are implementations of this algorithm elsewhere, too. - erik