Page 1 of 1
How to use threads ?
Posted: Mon Aug 07, 2006 4:44 am
by Lord_Coder
Hi all,
i want know how to use threads on my kernel , for example to call two functions at the same time .
Thanks for any reply .
Re:How to use threads ?
Posted: Mon Aug 07, 2006 5:03 am
by Solar
Are you serious?
::)
Have you coded multithreading in user space, before?
Re:How to use threads ?
Posted: Mon Aug 07, 2006 6:18 am
by Pype.Clicker
i'd recommend you to get a look at
OSFAQ:ContextSwitching and see if that makes sense for you.
And indeed, as Solar said, the way you ask your question sounds like you were thinking of black magic beyond the word "thread", so make sure you're familiar with the notions of dead-locks, synchronisation primitives such as sempahores and mutexes and that you have no hesitation whether code of your own is or isn't reentrant before you start meddling with multitask support.
Iirc from your previous post, you're french-speaker, no? If that's the case, i suggest you check the articles serie about ENIX/SOS (see
http://sos.enix.org/) from Linux Magazine...
Re:How to use threads ?
Posted: Mon Aug 07, 2006 8:17 am
by Lord_Coder
Solar wrote:
Have you coded multithreading in user space, before?
Yes , in C++ , i used PThreads ( Posix Threads ) .
I'ill look at the "Context Switching" article on the OsFaq .
Thanks for the replys .
Re:How to use threads ?
Posted: Tue Aug 08, 2006 3:34 am
by Lord_Coder
I found a great article about multitasking , here's the link :
http://www.osdever.net/tutorials/multit ... ?the_id=84 .
Re:How to use threads ?
Posted: Tue Aug 08, 2006 6:57 am
by Pype.Clicker
(hehe ... beyond infinity's tutorial ... yep. I think it is mentionned on the FAQ)