6-on-1(2) - Lecture Notes 10 Processes and Threads Anand...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
3/24/2008 CSci 4061 - Instructor: A. Tripathi 1 Lecture Notes 10 Processes and Threads Anand Tripathi CSci 4061 Introduction to Operating Systems 3/24/2008 CSci 4061 - Instructor: A. Tripathi 2 Process and Thread • Threads and Processes • Refer to Chapters 4 from the Silberschatz book (7 th Edition) 3/24/2008 CSci 4061 - Instructor: A. Tripathi 3 Process vs. Threads •A process contains only one execution context which comprises of: – Program counter – CPU registers – One stack in its address space • A conventional process is single threaded . – One execution context – One stack Address 0 Program Code (TEXT) Initialized Static Data Uninitialized Static Data Heap for dynamic memory al ocation Stack Stack pointer Command line arguments and environment variables 3/24/2008 CSci 4061 - Instructor: A. Tripathi 4 Single and Multithreaded Processes Shared by threads 3/24/2008 CSci 4061 - Instructor: A. Tripathi 5 Multithreaded Process • Threads execute concurrently . They represent parallel activities. • Threads of a process execute in a shared address space . • Threads share code, data, open files, signal handlers. • Each thread has its own execution context and stack for function call executions. 3/24/2008 CSci 4061 - Instructor: A. Tripathi 6 Benefits of Threads •E c o n om y – Cheaper to create and manage as compared to processes • Responsiveness – An application program can perform several tasks
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

6-on-1(2) - Lecture Notes 10 Processes and Threads Anand...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online