About processes and threads: about processes and threads

Source: Internet
Author: User

Each process provides the resources needed to execute a program. A process has a virtual address space, executable code, open handles to system objects, a security context, a unique process identifier, environment variables, a priority class, minimum and maximum working set sizes, and at least one thread of execution. each process is started with a single thread, often called the primary thread, but can create additional threads from any of its threads.

Each process provides oneProgramRequired resources. The process has virtual address space and runsCodeThe system object exposes the handle, a security context, a unique process identifier, environment variables, a priority class, the minimum maximum working set size, and at least one execution thread. Each process starts with a thread commonly called the main thread, but it can also create additional threads from any of its subthreads.

A thread is the entity within a process that can be scheduled for execution. all threads of a process share its virtual address space and system resources. in addition, each thread maintains exception handlers, a scheduling priority, thread local storage, a unique thread identifier, and a set of structures the system will use to save the thread context until it is scheduled. the thread context parameters des the thread's set of machine registers, the kernel stack, a thread environment block, and a user stack in the address space of the thread's process. threads can also have their own security context, which can be used for impersonating clients.

A thread is the entry for process scheduling and execution. All threads of the Process share virtual address space and system resources. In addition, each thread maintains its exception handling program, a scheduling priority, thread address storage, a unique thread ID, and a series of structures used to save the thread context until it is scheduled. The thread context includes the machine register set, core stack, a thread environment block, and a user stack in the address space of the thread's process. Threads can also have their own security context and can be used to simulate multiple customers.

Microsoft Windows supports preemptive multitasking, which creates the effect of simultaneous execution of multiple threads from multiple processes. on a Multiprocessor computer, the system can simultaneously execute as your threads as there are processors on the computer.

Microsoft Windows supports preemptible multi-task execution to achieve multi-processor and multi-thread synchronous execution. On a multi-processor computer, the system can run concurrently with multiple threads because multiple processors are on the machine.

A job object allows Groups of processes to be managed as a unit. job objects are namable, securable, sharable objects that control attributes of the processes associated with them. operations completed MED on the job object affect all processes associated with the job object.

A job (task) object allows multi-line processes to be managed as a whole. Job objects are named, secure, and shared objects that control all attributes of processes related to them. The execution of operations on the job object affects all processes related to the job object.

An application can use the thread pool to reduce the number of application threads and provide management of the worker threads. applications can queue work items, associate work with waitable handles, automatically Queue Based on a timer, and bind with I/O.

An application can use a thread pool to reduce the number of application threads and manage working threads. Applications can queue work items, associate work with wait handles, automatically Queue Based on timer, and bind Io.

From:

Http://msdn.microsoft.com/en-us/library/ms681917

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.