Creating threads.
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Creating threads.
What happens when you try to create a thread on a single core? Does it create a fake thread? Or does it return an error? I don't have a single core, so I can't tell.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
Each thread is run for very short time. Then the current processor state is saved somewhere and the processor state of another thread is loaded (called a context switch) and then the next thread runs a very short time. So when each thread is using up it's whole slice of time then for x threads each of them will only have 1/x of the available processor time (minus some minor additional time needed for the context switch). But threads can also give up their time earlier, for example with sleep(), if they have nothing to do.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm