timer_create fails (return=-1 errno=0)

Grant Edwards grant.b.edwards at gmail.com
Wed Oct 19 15:09:55 UTC 2011


On 2011-10-19, Richard Braun <rbraun at sceen.net> wrote:
> On Wed, Oct 19, 2011 at 02:24:49PM +0000, Grant Edwards wrote:

>> It's way simpler to use SIGEV_SIGNAL and then set up a thread that
>> calls sigwaitinfo() in a loop waiting for the timer signal.  The
>> kernel's quite good at keeping track of timers and figuring out when
>> the next one times. :)
>
> The problem with that approach is the limited number of available
> timers. From the current Debian man page:
>
> ``The kernel preallocates a "queued real-time signal" for each timer
> created using timer_create(). Consequently, the number of timers is
> limited by the RLIMIT_SIGPENDING resource limit (see setrlimit(2)).''
>
> This limit is 11 under Linux. This kind of problems is usually solved
> through abstraction libraries such as libevent.

I only need 8, so that's good enough. This code is just
proof-of-concept -- eventually some of it's getting moved into
hardware, and the rest into kernel-space.

-- 
Grant Edwards               grant.b.edwards        Yow! DIDI ... is that a
                                  at               MARTIAN name, or, are we
                              gmail.com            in ISRAEL?



More information about the uClibc mailing list