Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CSCI 3120 Midterm Exam Questions With Already Passed Solutions (Graded A+)

Rating
-
Sold
-
Pages
8
Grade
A+
Uploaded on
13-05-2025
Written in
2024/2025

What is a thread library? - Answer An API that programmers can use to create and manage threads How can a thread library be implemented? - Answer User Level - Entirely implemented in user space. No system calls are made. Kernel Level - Implemented with kernel support, ie. handled by OS. Typically results in a system call What are the main thread libraries used today? - Answer POSIX Pthreads Windows thread library Java thread API What is POSIX? - Answer A family of standards. Used to ensure compatibility between operating systems. Defines API behavior, and the shell U/I requirements. Are POSIX pthreads user level or kernel level? - Answer Can be both. In Linux they are kernel level. Is the Windows thread library user level or kernel level? - Answer Kernel level Is the Java thread API user level or kernel level? - Answer User level in that the thread is created on the machine itself, but in doing this the Windows thread library or POSIX pthreads are typically invoked depending on the host OS. What is asynchronous threading? - Answer Once parent creates child thread, parent continues to run without any knowledge of what the child thread is doing. Very little data sharing between threads.

Show more Read less
Institution
CSCI 3120
Course
CSCI 3120

Content preview

CSCI 3120 Midterm Exam Questions
With Already Passed Solutions (Graded
A+)
What is a thread library? - Answer An API that programmers can use to create and manage
threads



How can a thread library be implemented? - Answer User Level - Entirely implemented in user
space. No system calls are made.



Kernel Level - Implemented with kernel support, ie. handled by OS. Typically results in a system
call



What are the main thread libraries used today? - Answer POSIX Pthreads



Windows thread library



Java thread API



What is POSIX? - Answer A family of standards. Used to ensure compatibility between
operating systems.



Defines API behavior, and the shell U/I requirements.



Are POSIX pthreads user level or kernel level? - Answer Can be both. In Linux they are kernel
level.



Is the Windows thread library user level or kernel level? - Answer Kernel level



Is the Java thread API user level or kernel level? - Answer User level in that the thread is
created on the machine itself, but in doing this the Windows thread library or POSIX pthreads
are typically invoked depending on the host OS.

, Typically used for responsive user interfaces.



What is synchronous threading? - Answer The parent thread is not allowed to continue
execution until the children have finished working.



Typically involves significant data sharing between threads.



Where does the first thread begin in a program? - Answer In the main() function



How do threads share data? - Answer Using global variables



What datatype is used to reference a child process? - Answer pid_t, implemented as an int



What datatype is used to reference a child thread? - Answer pthread_t



When we create a thread in C in practice what do we need to do? - Answer Create a pthread_t
object to reference the thread (id)



Create a pthread_attr_t object to reference the attributes of the thread (attr)



------



Call pthread_attr_init(attr) to initialize your attributes



Call pthread_create(id, attr, function, param) which creates the new thread and specifies which
function will be called in the thread, passes in any parameters



Call pthread_join(id) after the create function IF you want the parent to wait for the child to
finish



Call pthread_exit in the child function when you want to end the thread.

Written for

Institution
CSCI 3120
Course
CSCI 3120

Document information

Uploaded on
May 13, 2025
Number of pages
8
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$12.99
Get access to the full document:

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


Also available in package deal

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.
COCOSOLUTIONS Nursing
Follow You need to be logged in order to follow users or courses
Sold
189
Member since
2 year
Number of followers
16
Documents
8138
Last sold
1 day ago
COCO SOLUTIONS ACADEMIC STORE

COCO SOLUTIONS ACADEMIC STORE YOU GET ALL KIND OF EXAMS,STUDYGUIDES,ASSIGNMENTS,FLASHCARDS,NOTES,SUMMARIES,REVIEWS .ALL YOUR ACADEMIC SOLUTIONS WE GOT YOU COVERED.WE ARE YOUR STUDY SOLUTION ,MAKING YOUR EDUCATION JOURNEY SMOOTH AND EFFICIENT FOR MORE ENQUIRIES FEEL FREE TO REACH US OUT.

4.1

31 reviews

5
16
4
6
3
7
2
1
1
1

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

Working on your references?

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

Working on your references?

Frequently asked questions