Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Nov 2007 20:02:27 -0400
From:      "Michael B Allen" <ioplex@gmail.com>
To:        "Peter Jeremy" <peterjeremy@optushome.com.au>
Cc:        freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: timers and semtimedop(2)
Message-ID:  <78c6bd860711011702k78e0aa3dy725c1a2d9c690c1b@mail.gmail.com>
In-Reply-To: <20071101195123.GJ25671@server.vk2pj.dyndns.org>
References:  <78c6bd860711011041o6d10753an663f19389737f84b@mail.gmail.com> <20071101195123.GJ25671@server.vk2pj.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/1/07, Peter Jeremy <peterjeremy@optushome.com.au> wrote:
> On Thu, Nov 01, 2007 at 01:41:10PM -0400, Michael B Allen wrote:
> >I need semtimedop(2). I'm thinking I can just do a semop with a SIGINT maybe.
>
> I presume you mean SIGALRM.
>
> >Can someone suggest a good method for setting up a timer to deliver
> >the signal? What sort of timers does FreeBSD offer?
>
> Assuming you aren't planning on creating a new syscall: man setitimer
> There's also kqueue EVFILT_TIMER but that is probably only useful if
> you are already using kqueue for other purposes.

Hi Peter,

On second thought I decided to use the application's existing event
loop to call semop and notify the waiter. It's not a self contained
solution and it won't work if the event loop itself is the waiter  but
it it almost always pays not to use signals if you don't absolutely
have to.

Thanks,
Mike



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?78c6bd860711011702k78e0aa3dy725c1a2d9c690c1b>