100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

[Operating Systems (ECE 478)] Final Exam Material Question and answers rated A+

Rating
-
Sold
-
Pages
25
Grade
A+
Uploaded on
30-12-2024
Written in
2024/2025

[Operating Systems (ECE 478)] Final Exam Material Question and answers rated A+ Multiprocessing - correct answer TODO: define Advantages over multithreading: * Memory isolation for protection and reliability Examples where used: * Web browsers Multithreading - correct answer TODO: define Threads in a process share the same address space: * Code * Data * Heap * Open files Unique for each thread: * Program counter (PC) * Register set * Stack Reasons to use

Show more Read less
Institution
IE 478
Course
IE 478










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
IE 478
Course
IE 478

Document information

Uploaded on
December 30, 2024
Number of pages
25
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

[Operating Systems (ECE 478)] Final
Exam Material Question and answers
rated A+
Multiprocessing - correct answer ✔TODO: define


Advantages over multithreading:
* Memory isolation for protection and reliability


Examples where used:
* Web browsers


Multithreading - correct answer ✔TODO: define


Threads in a process share the same address space:
* Code
* Data
* Heap
* Open files


Unique for each thread:
* Program counter (PC)
* Register set
* Stack


Reasons to use:

,* Resource sharing: Sharing memory
* Responsiveness: fast thread creating
* Parallelism: using multiple CPU( core)s to make some work get completed
faster
* Avoid blocking program process because of slow I/O


Advantages over multiprocessing:
* Fast in creating threads
* Saving memory space by sharing among different threads from the same
process if possible


Examples where used:
* Web servers


Thread - correct answer ✔An abstraction of a code sequence and (its
execution) state within one process


Types:
* Pthread: standardized thread programming interface seen in Unix and Linux


Thread control block (TCB) - correct answer ✔A data structure containing
information that an OS uses to keep track of and manage threads, like their
state


Contains:
* Program counter (PC)
* Thread state (running, ...)
* Register values

, * Stack pointer
* A pointer to the process control block (PCB)
* ...


Critical section - correct answer ✔A segment of code where multiple threads
may be changing shared resources


Multiple threads executing the same [this] can result in a race condition


Race condition - correct answer ✔An undesirable bug where it is non-
deterministic which of multiple threads (or processes) will access (and
especially modify) a resource first


Can result from: Multiple threads executing the same critical section


Why counter++ (i.e. incrementing a variable) can result in [this]: counter++
compiles to 3 assembly instructions rather than just 1; this means it's no
longer an atomic operation and execution could switch off between any
instruction, rather than all 3 having to finish first
1. mov [some address], %eax // load the value of counter from memory into a
register
2. add $0x1, %eax // increment the register
3. mov %eax, [that same address] // store the contents of the register back
into memory (where it came from)


Possible solutions: Make the critical operations atomic
* Guarding critical sections with locks (mutual exclusion)
* Disabling interrupts for critical sections
* TestAndSet

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Academia199 Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
351
Member since
3 year
Number of followers
208
Documents
19079
Last sold
1 week ago

3.9

50 reviews

5
27
4
6
3
7
2
3
1
7

Recently viewed by you

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

Frequently asked questions