[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Periodic task functions...



>Having a unique "update" process would be a Good Thing (in terms of
>performance) not only for file-systems, but also for device drivers; In
>both cases, there are tasks which must be done (checked) periodically,
>whether the device driver is called or not.  In minixfs and modm0dev,
>this is accomplished by an auxiliary daemon process: this causes
>significant overhead, and even more importantly, this process runs in
>non-kernel mode, which forbids some functions like (*kernel->wake)()
>which would be extremely handy. 

And things like TCP, and for that matter almost every communications
protocol require a regular cleanout kicking. (There's no point in 
registering a timeout for each and every connection you have open)

>It would be nice to have a supplementary kernel function -- let's say
>add_periodic_task(short period, void (*func)()) -- to register function
>"func" to be executed _in kernel mode_ every "period" milliseconds. 

Sounds pretty handy, although it'd be a real time eater unless you keep 
the granularity pretty coarse.  I think that just having two lists,
one on (say) 5ms (200Hz) and the other say 500ms (2Hz) would probably cover
99.9% of the requirements, and be much lighter on the overhead.

>Any comments about this?

Yeah, please guys, for every add_* function, make sure there's a 
remove_* function 8)

>Thierry. 

-- 
# mike smith : miff@apanix.apana.org.au - Silicon grease monkey        #
# "The question 'why are the fundamental laws of nature mathematical'  #
# then invites the trivial response 'because we define as fundamental  #
# those laws which are mathematical'". Paul Davies, _The_Mind_of_God_. #