How to use threads ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Lord_Coder

How to use threads ?

Post 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 .
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:How to use threads ?

Post by Solar »

Are you serious?

:o ::)

Have you coded multithreading in user space, before?
Every good solution is obvious once you've found it.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to use threads ?

Post 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...
Lord_Coder

Re:How to use threads ?

Post 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 .
Lord_Coder

Re:How to use threads ?

Post by Lord_Coder »

I found a great article about multitasking , here's the link : http://www.osdever.net/tutorials/multit ... ?the_id=84 .
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:How to use threads ?

Post by Pype.Clicker »

(hehe ... beyond infinity's tutorial ... yep. I think it is mentionned on the FAQ)
Post Reply