forked from open-education-hub/operating-systems
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
general/drills: Add "User-level Threading Library" written task as exam
Add Markdown file storing the question scenario and the questions Modify config.yaml to render the new task Signed-off-by: Petru-Vlad Ionescu <[email protected]>
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
chapters/general/drills/tasks/user-level-threading-library.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# User-level Threading Library | ||
|
||
## Scenario | ||
|
||
We aim to implement a user-level threading library that provides a POSIX Threads (`pthreads`) API. | ||
The library should be portable across different operating systems and architectures and should be usable in programs written in various programming languages. | ||
|
||
Answer the following questions with "True" or "False" and justify the answer. | ||
Justification should be simple, 2-3 sentences for each answer. | ||
|
||
## Questions | ||
|
||
1. The library can only be used in programs written in compiled languages, NOT interpreted ones. | ||
Answer: False | ||
|
||
1. The library can work on operating systems with and without kernel-level thread support. | ||
Answer: True | ||
|
||
1. The library does not need to expose synchronization primitives (working with mutexes, spinlocks, condition variables). | ||
Answer: False | ||
|
||
1. Programs using the library must be dynamically linked. | ||
Answer: False | ||
|
||
1. Code within the library does produce page faults. | ||
Answer: False | ||
|
||
1. Code within the library does not lead to system calls. | ||
Answer: False | ||
|
||
1. For creating a thread on Linux, the library uses the `clone()` system call. | ||
Answer: False | ||
|
||
1. Programs using the library can run in a Docker container. | ||
Answer: True | ||
|
||
1. Modifying a file cursor in one thread will be visible in another thread. | ||
Answer: True | ||
|
||
1. A program using the library will use only one core/processor. | ||
Answer: True | ||
|
||
1. Programs using the library cannot use shared memory to communicate with other processes. | ||
Answer: False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters