




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
COP4600 Midterm Review Exam Questions and Answers with Complete Solutions | 100% pass
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!
______ is a part of a process that has ______ - ✔✔Thread; It's own execution history( can't have without a stack) Program Counter Stack Every process has ______ threads and every thread ____ - ✔✔one or more threads; belongs to exactly one process Elements that are unique to a process but not a thread - ✔✔text(instructions) data (constants/statics) heap( dynamic allocations) Reason to use multiple threads instead of process - ✔✔Can reduce overhead and facilitate sharing **Threading: Classical Model; Explain Uniprogrammed, Multiprocess Model, and Threaded Model - ✔✔Uni: One process at at time, wait for a process to finish; Multiprocess:Process switch in and out. Threaded switch between threads within a process. ( this reduces context switch times) Why do we use threads - ✔✔-break up complicated tasks into simple ones
compared to new processes, threads have - ✔✔-lower memory cost(shared segments)
What do process need to communicate to each other? And what two problems does this mean we have to address? - ✔✔Process have to: Transmit data Notify each other of events (user did something dumb) Update Status ( I'm alive, don't kill me) Two Problems: Synchronize process ( so they can communicate) Actually transfer the info IPC Shared Memory versus Message Passing - ✔✔Share Memory: Directly write to memory require shared space caching & consistency issues requires explicit synchronization Message Passing: library or OS support needed some assembly required handles synchronization issues avoid memory specific problems _____ accepts data parcels and deliver them between processes - ✔✔Message passing systems Two main message passing systems mentioned in slides - ✔✔Pipes: Named/Unnamed (Unnamed: Parent to child, Named: 2 diff processes Linux ) Set and Use Local Host Only
Networks : TCP/UDP Requires more setup Host to host support When do we get a race condition? - ✔✔When results depend on timing that is not synchronized What are critical regions/sections? - ✔✔Regions of codes that we must protect. What must we maintain to avoid race conditions? - ✔✔1. Concurrency: We can't make any assumptions about the speed or the # of CPUS
Mutex:
Peterson Solution - ✔✔Busywaiting; combines flagging and alternation approaches Why do spin locks suck? - ✔✔spin locks( busy waiting ) inefficiently use the CPU while waiting for a resource; What is the Producer Consumer problem - ✔✔-also called the bounded buffer problem