Blue Theme Orange Theme Green Theme Red Theme
 
Nevron Chart
Home | Forums | Videos | Advertise | Certifications | Downloads | Blogs | Interviews | Jobs | Beginners | Training
 | Consulting  
Submit an Article Submit a Blog 
 Jump to
Skip Navigation Links
TechnologyExpand Technology
WebsiteExpand Website
Nevron Chart
Search :       Advanced Search »
Home » Windows Forms » Chapter 6: Process Management

Chapter 6: Process Management

This chapter explains the basics of process management and also introduces the basic synchronization operations and wait functions that will be important throughout the rest of the book.

Technologies: Windows Forms
Author Name: JOHNSON M Hart
Total downloads : 0
Total page views :  14377
Rating :
 4.5/5
This article has been rated :  2 times
  Add to Technorati Add to Technorati    Digg This Digg This    Add to del.icio.us Add to del.icio.us
    Rate this article Read/Post comments Support Us   Printable Version 

Chapter Contents
1. Introduction
2. Process Creation
3. Process Identities
4. Process Security
5. Process Execution Times
6. Getting a Job Number
7. Summary

Mindcracker MVP Summit 2012
Become a Sponsor
 Tag Cloud
 Latest Jobs
More ... 
 Latest Interview Questions
More ... 

A process contains its own independent virtual address space with both code and data, protected from other processes. Each process, in turn, contains one or more independently executing threads. A thread running within a process can execute application code, create new threads, create new independent processes, and manage communication and synchronization among the threads.

By creating and managing processes, applications can have multiple, concurrent tasks processing files, performing computations, or communicating with other networked systems. It is even possible to improve application performance by exploit multiple CPU processors.

This chapter explains the basics of process management and also introduces the basic synchronization operations and wait functions that will be important throughout the rest of the book.

Windows Processes and Threads

Every process contains one or more threads, and the Windows thread is the basic executable unit; see the next chapter for a threads introduction. Threads are scheduled on the basis of the usual factors: availability of resources such as CPUs and physical memory, priority, fairness, and so on. Windows has long supported multiprocessor systems, so threads can be allocated to separate processors within a computer.

From the programmer's perspective, each Windows process includes resources such as the following components:

  • One or more threads.
  • A virtual address space that is distinct from other processes' address spaces.

    Note that shared memory-mapped files share physical memory, but the sharing processes will probably use different virtual addresses to access the mapped file.
     
  • One or more code segments, including code in DLLs.
  • One or more data segments containing global variables.
  • Environment strings with environment variable information, such as the current search path.
  • The process heap.
  • Resources such as open handles and other heaps.

Each thread in a process shares code, global variables, environment strings, and resources. Each thread is independently scheduled, and a thread has the following elements:

  • A stack for procedure calls, interrupts, exception handlers, and automatic storage.
  • Thread Local Storage (TLS)-An array like collection of pointers giving each thread the ability to allocate storage to create its own unique data environment.
  • An argument on the stack, from the creating thread, which is usually unique for each thread.
  • A context structure, maintained by the kernel, with machine register values.

Figure 6-1 shows a process with several threads. This figure is schematic and does not indicate actual memory addresses, nor is it drawn to scale.

This chapter shows how to work with processes consisting of a single thread.

Chapter 7 shows how to use multiple threads.

Note: Figure 6-1 is a high-level overview from the programmer's perspective. There are numerous technical and implementation details, and interested readers can find out more in Russinovich, Solomon, and Ionescu, Windows Internals: Including Windows Server 2008 and Windows Vista.

A UNIX process is comparable to a Windows process.

Threads, in the form of POSIX Pthreads, are now nearly universally available and used in UNIX and Linux. Pthreads provides features similar to Windows threads, although Windows provides a broader collection of functions.

Vendors and others have provided various thread implementations for many years; they are not a new concept. Pthreads is, however, the most widely used standard, and proprietary implementations are long obsolete. There is an open source Pthreads library for Windows.



Figure 6.1 - A Process and its Threads

Total Pages : 7 12345


        Rate this article Read/Post comments Support Us   Printable Version
 Book Detail
Book Title : Windows System Programming
Author: JOHNSON M Hart
Publisher: Addison Wesley
Price: 48.99 US$
EBook Price: 48.99 US$
Book Url: http://my.safaribooksonline.com/9780321658319
 Post a new question or comment about this article
Subject:
Comment:
 [Top] Rate this article:-
Looking for C# Consulting?
C# Consulting is founded in 2002 by the founders of C# Corner. Unlike a traditional consulting company, our consultants are well-known experts in .NET and many of them are MVPs, authors, and trainers. We specialize in Microsoft .NET development and utilize Agile Development and Extreme Programming practices to provide fast pace quick turnaround results. Our software development model is a mix of Agile Development, traditional SDLC, and Waterfall models.
Click here to learn more about C# Consulting.
Latest Comments:
Subject Posted By Posted On
Support Us
Tell your friends about us
Is this article is a Bad Submission report us here
Submit articles, tutorials, and tips
Help by answering questions on our discussion forums
Help us correct errors and broken links
Looking for a job? Post your resume here
Looking for developers? Post your job here

Nevron Chart
 © 2012  contents copyright of their authors. Rest everything copyright Mindcracker. All rights reserved.