regarding timeout/untimeout kernel functions
Dan Nelson
dnelson at allantgroup.com
Thu Jul 22 19:56:07 PDT 2004
In the last episode (Jul 22), pradeep reddy punnam said:
> i thought of threading with select before , but i belive that if
> the number of timers to be checked increases the number of the
> threads to be maintained increses,so the process may become very
> hevy. what do u think.
Threads are very lightweight. You should be able to create hundreds of
(mostly-sleeping) threads with no problem. You wouldn't even need to
use select; just sleep (or nanosleep).
> i think ultimatley i am going to use the above thing. but in the
> process of my search i came across the timeout kernel function
> implemenation but i can not use that ( which i belive very efficient
> implementation of timers ), which user can not able to use it , so i
> just want to discuss it .
You could also use the kqueue/kevent functions to queue up an arbitrary
number of timer events in a single process.
--
Dan Nelson
dnelson at allantgroup.com
More information about the freebsd-hackers
mailing list