User threads basic question

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
mangaluve
Member
Member
Posts: 110
Joined: Mon Feb 23, 2009 6:53 am

User threads basic question

Post by mangaluve »

I just wonder about user threads. Suppose I run a user application and want threads. Should the context switches within my application go through the kernel (so basically I just have one kind of thread almost, it really doesn't matter to the kernel), or should the application handle it by itself?
skyking
Member
Member
Posts: 174
Joined: Sun Jan 06, 2008 8:41 am

Re: User threads basic question

Post by skyking »

Both could work, but your kernel has to have some supporting features for the options to be usable. For the first options your kernel must of course support multitasking. The second need the possibility to handle blocking syscalls (or equivalent) properly - if you do the thread switching in the process it self it can't really be useful if the whole process is blocked by fx a file read.
mangaluve
Member
Member
Posts: 110
Joined: Mon Feb 23, 2009 6:53 am

Re: User threads basic question

Post by mangaluve »

Can you give any examples, for instance, what does Linux use? I think it looks simplier to do everything via the kernel..
Post Reply