On thread scheduling

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux Kernel Mailing List <linux-kernel@...>
Date: Friday, September 14, 2007 - 6:40 pm

Consider a simple embedded system:

void interrupt_handler(void)
{
	...
}

int main(void)
{
	...
}

I would like to "emulate" this system with a workstation to make 
development faster. I would create two threads, one executing the 
main() function, and the other occasionally calling interrupt_handler(). 
Before interrupt_handler() is called, the main() thread should be 
stopped asynchronously.

I looked into pthreads documentation and found only pthread_kill(thread, 
SIGTSTP) to do asynchronous stop, but then I also have to play terminal 
tricks to avoid problems..

Is there are function to just disable scheduling of a single thread 
without having other side-effects (such as terminal stuff)? Functions 
like pthread_disable_scheduling(thread) and 
pthread_enable_scheduling(thread) would be good for this..

-- 
Heikki Orsila			Barbie's law:
heikki.orsila@iki.fi		"Math is hard, let's go shopping!"
http://www.iki.fi/shd
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
On thread scheduling, Heikki Orsila, (Fri Sep 14, 6:40 pm)
Re: On thread scheduling, Kyle Moffett, (Sun Sep 16, 3:16 am)
Re: On thread scheduling, Ray Lee, (Sat Sep 15, 10:54 am)
Re: On thread scheduling, Matthias Kaehlcke, (Sat Sep 15, 1:39 am)