Re: threaded question
"Antoine W. Campagna" <[email protected]>
| Newsgroups | gmane.comp.windows.shells.litestep |
|---|---|
| Message-ID | <[email protected]> |
On 5/3/07, Hale, Paul <[email protected]> wrote: > > Since I have been reading the NetLoadModule readme, I figured I would > finally ask what I never understood. What the hell is threaded, what > does it do and when should it be used? > > Paul Hale A thread is a parrallel execution of a routine. Every process running in your computer have at least one thread. Just like there are many processes running in parrallel on your CPU, there may be many threads inside a process running in parallel. Threads are very helpful in modern programming, mainly to have UI responsiveness (in some thread) even when working with slow IO (like network communication in some other thread). Or to take advantage of mutli-core CPUs for long calculations. Having things multithreaded is a good thing because it allows a portion to execute while another is waiting after something (say a directory listing or a process startup). It can reduce or eliminate all the UI freezing that can be observed in many programs (including LS). But multithread means that intermodule communication is harder and must be either asynchronous or blocking. The threaded option allows for a module to be run in its own thread. Loading some modules threaded has advantages but it might disrupt the way it communicates with the core and/or other modules. I don't think no one tried which situations were benefitial from using threaded. So when should it be used ? I don't know, when it works probably. Antoine