• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 7 pages
Exam (elaborations)

ecs 150 quiz 3

Document preview thumbnail
Preview 2 out of 7 pages

Exam of 7 pages for the course advance nursing at advance nursing (ecs 150 quiz 3)

Content preview

ecs 150 quiz 3
kernel level thread - - a thread the OS knows about

- every process is composed of at least one kernel level thread

- kernel manages and schedules threads

- can also have internal threads : "kernel thread"

- switching between kernel level threads requires a context switch



user level threads - - a thread the OS does not know about

- OS only schedules processes, not potential threads within processes

- programmer uses a thread library to manage threads

- user level code can define scheduling policy

- switching between user level threads does not involve a kernel context switch



what happens if thread blocks on an I/O? - the entire process gets blocked



kernel level thread pros: - - blocking system calls suspend the calling thread only

- can take advantage of multiple CPUs

- signals can be delivered more precisely

- used by existing systems (linux)



kernel level thread cons: - - can be heavy, not as flexible

sys calls = big overhead



user level thread pros: - - really fast to create and switch between threads ( no sys calls or context switch
necessary)

- customizable scheduler



user level thread cons: - - all threads of process are blocked on sys call

- customizable scheduler

, cooperative thread - thread runs until it yields control to another thread



- better scheduling control

- simpler shared resources

- leads to potential starvations



preemptive - threads are frequently interrupted and forced to yield



- certain guarantee of fairness

- resource sharing needs to be resistant to preemption

- scheduling is not deterministic



what happens on a fork? - we only copy the thread that calls fork()



what happens with shared data structures and files? - they require synchronization



what about signal delivery? - - some signals can be delivered to one particular thread

- other signals can be delivered to threads that have not blocked it



what about global variables in libraries? - they are shared between threads and may be overwritten



thread memory sharing: - - private processor registers

- private stack

- shared global memory



concurrency issues: indeterministic interleavings - - thread scheduling

- compiler instruction reordering

- hardware instruction reordering

Document information

Uploaded on
September 27, 2022
Number of pages
7
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers
$15.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
2
Followers
1
Items
583
Last sold
1 year ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions