Hi,
Thanks for your replies.
I checked the man pages for both timeout and taskq.
If I would use timeout only to start function A, and within function A do a
new call to timeout in order to keep it running each period, that would the
bad thing to do, right? Since then I would leave a trail of unfinished
functions behind...
Does the following strategy then work?
In function A, call timeout with function B as argument
In function B, first schedule a taskq that will run A, then do the necessary
things that are needed
Is it correct that in this way, since the scheduling the new taskq is the
first thing that is done, the actual time between invocations of the code is
quasi constant, i.e. does not depend on how long the actual code within B
takes?
Thanks, Thomas
On 4/23/07, Garrett D'Amore <[EMAIL PROTECTED]> wrote:
Paul Durrant wrote:
> On 4/23/07, Thomas De Schampheleire <[EMAIL PROTECTED]> wrote:
>>
>> - Have a thread run containing a while loop with a delay inside. This
>> would
>> have the disadvantage that the time between the thread's execution is
>> run is
>> not always fixed (it would depend on the load of the system, ...).
>>
>
> To some extent, yes. You could use something like lbolt to normalize
> this though.
>
>> - Schedule a task to run at certain times. How do I achieve this? Which
>> functions can I use from within the kernel to use the timer?
>>
>
> You could use timeout().
>
>> - Are there any other possibilities? Do they have certain
>> advantages/disadvantages?
>>
>
> You could also look at the interface in cyclic.h. The only problem
> with this is that it's not a public interface and so your build env.
> would be tied to ON.
Please don't use cyclic.h right now. Much better, IMO, to use timeout()
or taskq(9f) or some combination of the two.
-- Garrett
>
> Paul
>
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code