When using POSIX threads, a thread’s start routine takes just one parameter. How do you pass in a value for this parameter?
a. You can’t provide a value for this parameter. It’s automatically set to null for the first thread that’s created. For each subsequent thread, it’s a pointer to a handle for the most recently created thread.
b. When you call the start routine from main(), you can provide a value for this parameter.
c. The last parameter to pthread_create() is passed in to the start routine.
d. You can’t pass in a value for this parameter. The operating system uses this parameter to give the thread a pointer to its own thread handle.
2. If you’re using POSIX threads, what happens when a thread returns from its start routine?
a. That thread returns back to main() and resumes executing there.
b. That thread goes back to the top of its start routine and continues executing from there.
c. That thread terminates.
d. Threads can’t return from their start routine. Instead, they have to call pthread_join() to wait until other threads are finished.
3. What are shared by threads? Select two answers that apply.
a. Program Counter
b. Opened files
4. Which of these best describes a difference between user-level and kernel-level threads running inside the same process? Pick the best answer.
a. User-level threads can share stack space, but kernel-level threads each need their own stack.
b. User-level threads each have a different heap and data section, but kernel-level threads can share these.
c. The maximum number of kernel-level threads is limited to the number of CPU cores, but a process can have any number of user-level threads.
d. Kernel-level threads require a system call to create a new thread, but user-level threads can make a new thread with a subroutine call.
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.Read more
Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.Read more
Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.Read more
Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.Read more
By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.Read more