Date: Thu, 22 Jul 2004 20:29:20 -0500 From: Joseph M Link <freebsd@joelink.net> To: pradeep reddy punnam <prady_p@yahoo.com> Cc: freebsd-hackers@freebsd.org Subject: Re: regarding timeout/untimeout kernel functions Message-ID: <410069F0.5040604@joelink.net> In-Reply-To: <20040723005940.18029.qmail@web53410.mail.yahoo.com> References: <20040723005940.18029.qmail@web53410.mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
If you're willing to take some precautions, you could run the timer code with select/usleep in a separate thread. However, since the callbacks would originate from that thread, you would need mutexes to protect any data that the function accesses that could also be accessed by the normal program flow. Joe pradeep reddy punnam wrote: > HI all, > i am working on a project , where i came across a situation where i need to execute a function when a timer expires ,exactly similar to functionality of the timeout() kernel function but i need this in userland(application), and the execution of the function is time sensitive, it should be run immediately when timer expires. > > i can't be using poll or select for timer becuse those will block the process untill the timer expires.for me the proess should not be blocked. > and i also thought of taking the service of the timeout function by writing a system call and using signaling mechanism but i think this will become expensive when the number of timers to be checked increeses. > > i read the kern_timeout.c code that is very good implentation.with very less expensive. > but i think user unable to enjoy that service. > > i will thankful if somebody can tell if there is any such a service or way provided by os( that i overlooked). > > thanks, > > -Pradeep > > > > > > > --------------------------------- > Do you Yahoo!? > Vote for the stars of Yahoo!'s next ad campaign! > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?410069F0.5040604>