BlackRussian
asked on
how to schedule threads for time
Hi I'm using pthreads. I've have not been able to find a examples showing how to schedule thread execution based on time. For example if i want a thread to run every 100ms. Can anyone point me to some good example code.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
excuse me - You haven'k know the usleep() function?
Maybe You should then ask - how to sleep for 100ms....
Maybe You should then ask - how to sleep for 100ms....
What You need is real time scheduling - try http://www.tldp.org/HOWTO/RTLinux-HOWTO.html
Or maybe You just need to do something, then sleep for about 100ms, then do something else and so on?
You could make one of threads a scheduler, which would trigger other threads(mutex, waitqueue, etc.) at given time points...