ch3 - CS 7103 Advanced Operating Systems Louisiana State...

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

View Full Document Right Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan •Processes are programs in execution --- Each process has its own PCB, page table and address space. •Threads are lightweight processes --- Multiple threads run on a process sharing the address space of the process. --- Each thread has its own TCB consisting of program counter, stack pointers and register set. --- Further each thread has its own stack.
Background image of page 2
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Ease of creation – no need to copy address space Context switching is cheaper, particularly for threads implemented in user space Allow concurrency as well as blocking system calls making the programming easier Simpler and more efficient resource sharing
Background image of page 3

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Per process items Per thread items All Thread Items + Address Space Global Variables Open Files Timers Signals Semaphores Accounting Info Program Counter Stack Register set Child Threads State
Background image of page 4
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Dispatcher-workers model. Team model. Pipeline model.
Background image of page 5

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Dispatcher thread Requests Worker thread
Background image of page 6
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Thread Thread Thread Requests o Identical threads o Not identical threads o Static o Dynamic
Background image of page 7

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Requests Thread Thread Thread
Background image of page 8
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Thread creation -- Static vs. Dynamic. Thread termination Thread synchronization Thread scheduling -- Priority assignment, quantum size variation, handoff and affinity scheduling. Signal handling -- Signal handler, signals must not be lost.
Background image of page 9

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Thread Synchronization Design Issues -- Access to Shared Data using Critical Regions --Implemented using Mutexes and Condition Variables lock mutex; check data structures; while(resource busy) wait(cond. variable); mark resource busy; unlock mutex; lock mutex; mark resource free; unlock mutex; wakeup(cond. variable); Calling thread Owner thread
Background image of page 10
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Thread 1 Access() Thread 2 Open() Errno set Errno overwritten Errno inspected Error ! Using Global Variables
Background image of page 11

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

View Full DocumentRight Arrow Icon
CS 7103 Advanced Operating Systems Louisiana State University Rajgopal Kannan Thread 1 Allocating Private Global Variables Thread 1’s code Thread 1’s stack Thread 2’s code Thread 1’s global’s Thread 2’s stack Thread 2’s global’s
Background image of page 12
Louisiana State University Rajgopal Kannan Implementing in user space Implementing in kernel space Hybrid approach
Background image of page 13

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

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

This note was uploaded on 01/25/2010 for the course CSC 7103 taught by Professor Kannan,r during the Fall '08 term at LSU.

Page1 / 38

ch3 - CS 7103 Advanced Operating Systems Louisiana State...

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

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