search
Log In

Recent questions tagged threads

1 vote
3 answers
1
Consider the following multi-threaded code segment (in a mix of C and pseudo-code), invoked by two processes $P_1$ and $P_2$, and each of the processes spawns two threads $T_1$ and $T_2$: int x = 0; // global Lock L1; // global main () { create a thread to execute foo() ... will print the value of $y$ as $2.$ Both $T_1$ and $T_2$, in both the processes, will print the value of $y$ as $1.$
asked Feb 18 in Operating System Arjun 1.1k views
4 votes
2 answers
2
Degree of concurrency in threads can be arranged in the manner One-to-one > many-to-one > many-to-many One-to-one > many-to-many > many-to-one Many-to-many > many-to-one > one-to-one None of the above answer given is A but according to me answer is B. Someone please confirm
asked Sep 7, 2020 in Unknown Category Akanksha Agrawal 498 views
0 votes
2 answers
3
Which two are valid constructions for Thread? Thread(Runnable r, String name) Thread() Thread(int priority) Thread(Runnable r, ThreadGroup g) Thread(Runnable r, int priority) $1$ and $3$ $2$ and $4$ $1$ and $2$ $2$ and $5$
asked Apr 1, 2020 in Operating System Lakshman Patel RJIT 257 views
1 vote
3 answers
5
One of the disadvantages of user level threads compared to Kernel level thread is If a user level thread of a process executes a system call, all threads in that process are blocked. Scheduling is application dependent. Thread switching doesn’t require kernel mode privileges. The library procedures invoked for thread management in user level threads are local procedures.
asked Mar 24, 2020 in Operating System jothee 386 views
0 votes
1 answer
7
0 votes
1 answer
8
If a multithreaded process forks, a problem occurs if the child gets copies of all the parent’s threads. Suppose that one of the original threads was waiting for keyboard input. Now two threads are waiting for keyboard input, one in each process. Does this problem ever occur in single-threaded processes?
asked Oct 24, 2019 in Operating System Lakshman Patel RJIT 191 views
0 votes
0 answers
9
Assume that you are trying to download a large $2$-GB file from the Internet. The file is available from a set of mirror servers, each of which can deliver a subset of the file’s bytes; assume that a given request specifies the starting and ending bytes of the file. Explain how you might use threads to improve the download time.
asked Oct 24, 2019 in Operating System Lakshman Patel RJIT 220 views
0 votes
1 answer
10
0 votes
0 answers
11
Consider a system that has two CPUs, each CPU having two threads (hyperthreading). Suppose three programs, $P0, P1,$ and $P2$, are started with run times of $5, 10$ and $20$ msec, respectively. How long will it take to complete the execution of these programs? Assume that all three programs are $100\%$ CPU bound, do not block during execution, and do not change CPUs once assigned.
asked Oct 23, 2019 in Operating System Lakshman Patel RJIT 52 views
2 votes
2 answers
12
Which of the following are NOT shared by the threads of the same process? Stack Registers Address space Message queue a and d b and c a and b a, b and c
asked Jul 2, 2019 in Operating System Arjun 888 views
1 vote
1 answer
13
Given that a computer system has only 3 process.1st process is single threaded, 2nd process is two threaded and 3rd process is 4 threaded.So total how many number of page tables will be managed by the operating system?
asked Jun 4, 2019 in Operating System Sourajit25 295 views
0 votes
0 answers
14
User level threads doesnot require context switching- This is a true statement (Because OS cannot recognize user level threads) Can somebody elaborate more on it?? This given answer is wrong I think:https://gateoverflow.in/290648/made_easy_test_series Plz check
asked May 19, 2019 in Operating System srestha 229 views
0 votes
2 answers
15
A system provides support for user-level and kernel-level threads. The mapping in this system is one to one (there is a corresponding kernel thread for each user thread). Does a multithreaded process consist of $(a)$ a working set for the entire process or $(b)$ a working set for each thread ? Explain
asked Mar 22, 2019 in Operating System akash.dinkar12 225 views
0 votes
3 answers
16
Consider the following code segment: pid t pid; pid = fork(); if (pid == 0) { /* child process */ fork(); thread create( . . .); } fork(); a. How many unique processes are created? b. How many unique threads are created?
asked Mar 19, 2019 in Operating System akash.dinkar12 312 views
0 votes
0 answers
17
A system with two dual-core processors has four processors available for scheduling. A CPU-intensive application is running on this system. All input is performed at program start-up, when a single file must be opened. Similarly, all output is performed just before the ... the input and output ? Explain. How many threads will you create for the CPU-intensive portion of the application ? Explain.
asked Mar 19, 2019 in Operating System akash.dinkar12 178 views
0 votes
1 answer
18
Using Amdahl’s Law, calculate the speedup gain of an application that has a 60 percent parallel component for (a) two processing cores and (b) four processing cores.
asked Mar 19, 2019 in Operating System akash.dinkar12 693 views
0 votes
1 answer
19
1 vote
2 answers
20
Can a multithreaded solution using multiple user-level threads achieve better performance on a multiprocessor system than on a single processor system ? Explain.
asked Mar 19, 2019 in Operating System akash.dinkar12 117 views
1 vote
1 answer
21
Which of the following components of program state are shared across threads in a multithreaded process ? a. Register values b. Heap memory c. Global variables d. Stack memory
asked Mar 19, 2019 in Operating System akash.dinkar12 884 views
0 votes
0 answers
22
Under what circumstances does a multithreaded solution using multiple kernel threads provide better performance than a single-threaded solution on a single-processor system ?
asked Mar 19, 2019 in Operating System akash.dinkar12 62 views
0 votes
0 answers
23
0 votes
0 answers
24
Assume that an operating system maps user-level threads to the kernel using the many-to-many model and that the mapping is done through LWPs(Light Weight Processes). Furthermore, the system allows developers to create real-time threads for use in real-time systems. Is it necessary to bind a real-time thread to an LWP(Light Weight Process) ?Explain.
asked Mar 19, 2019 in Operating System akash.dinkar12 73 views
...