[fpc-pascal] lnet for TCP daemon

Henry Vermaak henry.vermaak at gmail.com
Wed Sep 18 23:53:22 CEST 2013


On Wed, Sep 18, 2013 at 03:57:36PM +0200, Marco van de Voort wrote:
> In our previous episode, Henry Vermaak said:
> > > > Should be doable, as well. AFAIK, mse (for Linux) uses signals
> > > > on that behalf. We might want to steal some ideas there.
> > > 
> > > While there is sigalarm, but can you have multiple independent
> > > timers in an application that way?
> > 
> > I think Martin used setitimer and handles multiple timers by
> > calculating which one expires first, and subtracting that amount
> > from the other timers, etc.
> 
> That's a trick commonly done on embedded platforms with limited timers
> (I actually did it once as part of a course that created a small RTOS
> for 8051 chips), but on *nix systems where libraries might also
> reserve certain itimers, that could fail miserably.

Yes, the POSIX interval timers are a much better solution for this.
Dealing with signals are still a bit annoying, but things like timerfd
and signalfd are linux specific.

Henry



More information about the fpc-pascal mailing list