what are threads and processes
-
please can you explain me what are threads and what are processes and what is the difference between the two ? thank you a lot
This won't be a very in depth answer, for more information check out "Advanced Windows" by Jeffrey Richter. A process is an instance of a running program. You start a program, it will run in a seperate "process". A process must own at least one thread to execute the code in its process. A thread runs within a process. A process can hold many threads, but it has to have at least one. A thread is what actually executes the code in a process. I know this is very brief, but I hope it helps a little. :-O Wayne
-
This won't be a very in depth answer, for more information check out "Advanced Windows" by Jeffrey Richter. A process is an instance of a running program. You start a program, it will run in a seperate "process". A process must own at least one thread to execute the code in its process. A thread runs within a process. A process can hold many threads, but it has to have at least one. A thread is what actually executes the code in a process. I know this is very brief, but I hope it helps a little. :-O Wayne
thanks, it helped a lot ... so process is running program each thread have its own registers like ax,bx,CS:IP. Right ? Use threads the same memory - memory of process ??? can one process access threads of another process? one more question: is it ok to create around 20 threads/process - for example each thread for each wininet download ???
-
thanks, it helped a lot ... so process is running program each thread have its own registers like ax,bx,CS:IP. Right ? Use threads the same memory - memory of process ??? can one process access threads of another process? one more question: is it ok to create around 20 threads/process - for example each thread for each wininet download ???
-
please can you explain me what are threads and what are processes and what is the difference between the two ? thank you a lot
A process is a thread container. The process defines the memory context in which 1 or more threads run. You can't have a process without at least one thread.
-
thanks, it helped a lot ... so process is running program each thread have its own registers like ax,bx,CS:IP. Right ? Use threads the same memory - memory of process ??? can one process access threads of another process? one more question: is it ok to create around 20 threads/process - for example each thread for each wininet download ???
"... so process is running program each thread have its own registers like ax,bx,CS:IP. Right ?" Not my expertise, but I think so, yes. "Use threads the same memory - memory of process ???" Same EXE image, yes. Global variables/objects is also shared between threads within a process. Locally defined variables/objects within a thread are not shared between threads. "can one process access threads of another process?" Don't think so. "one more question: is it ok to create around 20 threads/process - for example each thread for each wininet download ???" Yes, web servers usually contain many more threads than 20. Our company has software running 50+ threads also, a lot being threads with different tasks. Word uses a separate thread to print documents too, for example.
-
A process is a thread container. The process defines the memory context in which 1 or more threads run. You can't have a process without at least one thread.