TAILIEUCHUNG - Lecture Operating systems: Lesson 7 - Dr. Syed Mansoor Sarwar

Lecture Operating systems: Lesson 7 - Dr. Syed Mansoor Sarwar. The main topics covered in this lesson include: the wait and exec system calls and sample code, cooperating processes, producer-consumer problem, interprocess communication (IPC) and process synchronization, . | Operating Systems Lecture 7 Agenda for Today Review of previous lecture The wait and exec system calls and sample code Cooperating processes Producer-consumer problem Interprocess communication IPC and process synchronization Recap of the lecture 28 April 2022 Copyright Virtual University of Pakistan Review of Lecture 6 Schedulers long- and short- and medium-term Dispatcher Process creation and termination fork and exit system calls 28 April 2022 Copyright Virtual University of Pakistan wait The wait system call suspends the calling process until one of its immediate children terminates or until a child that is being traced stops because it has hit an event of interest. wait returns prematurely if a signal is received. If all children processes stopped or terminated prior to the call on wait return is immediate. 28 April 2022 Copyright Virtual University of Pakistan Synopsis of wait include include pid_t wait int stat_loc usr include sys 28 April 2022 Copyright Virtual University of Pakistan wait . If the call is successful the process ID of the terminating child is returned. If parent terminates all its children have assigned as their new parent the init process. Thus the children still have a parent to collect their status and execution statistics. 28 April 2022 Copyright Virtual University of Pakistan wait . Zombie process a process that has terminated but whose exit status has not yet been received by its parent process or by init. 28 April 2022 Copyright Virtual University of Pakistan Sample Code fork include void main int pid status pid fork if pid -1 printf fork failed n exit 1 2022 28 April Copyright Virtual University of Pakistan Sample Code fork if pid 0 Child printf Child here n exit 0 else Parent wait amp status printf Well done kid n exit 0 28 April 2022 Copyright Virtual University of Pakistan Semantics of fork P fork P 28 April 2022 Copyright Virtual University of Pakistan exec Typically the exec system call is used after a fork system call

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.