在msdn中对进程有详细定义:
进程是一个正在运行的程序,它拥有自己的虚拟地址空间,拥有自己的代码,数据和其他系统资源,如进程创建的文件,管道,同步对象等。一个进程也包含了一个或者多个运行在此进程内的线程
明白了吗?也就是说程序运行就有进程,不过看不看不到是另外一回
补充一下MSDN原版资料,lz可以看看:
About Processes and Threads
Each process provides the resources needed to execute a program. Aprocess has a virtual address space, executable code, open handles tosystem objects, a security context, a unique process identifier,environment variables, a priority class, minimum and maximum workingset sizes, and at least one thread of execution. Each process isstarted with a single thread, often called the <i>primarythread</i>, but can create additional threads from any of itsthreads.
A thread is the entity within a process that can be scheduled forexecution. All threads of a process share its virtual address space andsystem resources. In addition, each thread maintains exceptionhandlers, a scheduling priority, thread local storage, a unique threadidentifier, and a set of structures the system will use to save thethread context until it is scheduled. The thread context includes thethread's set of machine registers, the kernel stack, a threadenvironment block, and a user stack in the address space of thethread's process. Threads can also have their own security context,which can be used for impersonating clients.
Microsoft Windows supports preemptive multitasking, which createsthe effect of simultaneous execution of multiple threads from multipleprocesses. On a multiprocessor computer, the system can simultaneouslyexecute as many threads as there are processors on the computer.
A job object allows groups of processes to be managed as a unit. Jobobjects are namable, securable, sharable objects that controlattributes of the processes associated with them. Operations performedon the job object affect all processes associated with the job object.
A fiber is a unit of execution that must be manually scheduled bythe application. Fibers run in the context of the threads that schedulethem. Each thread can schedule multiple fibers. In general, fibers donot provide advantages over a well-designed multithreaded application.However, using fibers can make it easier to port applications that weredesigned to schedule their own threads.
[ 本帖最后由 yzx714 于 2009-1-13 18:09 编辑 ] |