Recent questions tagged process-and-threads

272
views
1 answers
0 votes
Which of the following multithreading model is followed in Linux OS?One User Thread mapping to One Kernel ThreadMany User Threads mapping to One Kernel ... mapping to Many Kernel ThreadsMany User Threads mapping to Many Kernel Threads
328
views
1 answers
0 votes
$\text{ Anyone please explain : }$
433
views
1 answers
1 votes
The figure shown below indicates a thread's movement between $3$ states (i.e., run, ready, and blocked). Explain what causes each arrow? Say $\text{N/A}$ if it doesn't happen.
870
views
0 answers
1 votes
MSQ Consider the following statements, which one of the following is/are TRUEIn fork() system call, child process inherits all the open file descriptors of ... of the parent process User level threads shares the code segment of the process
614
views
1 answers
3 votes
Consider a system using many-to-one pure user-level thread model in which Kernel is not aware of any user-level thread. Which of the following situations/states is/are ... .D)P is in ready state and a thread of P is in running state..
976
views
2 answers
0 votes
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$
380
views
0 answers
0 votes
Implement a program to count the frequency of words in a text file. The text file is partitioned into $N$ segments. Each segment is processed by ... it computes the consolidated word-frequency data based on the individual threads' output.
389
views
0 answers
1 votes
The objective of this exercise is to implement a multithreaded solution to find if a given number is a perfect number. $N$ is a perfect number if the sum of all ... by restricting the numbers searched from $1$ to the square root of $N.)$
342
views
0 answers
0 votes
A process can be put into a round-robin queue more than once to give it a higher priority. Running multiple instances of a program each working on a different ... processes, you should be able to grab a bigger share of the CPU this way.
740
views
0 answers
0 votes
Write a producer-consumer problem that uses threads and shares a common buffer. However, do not use semaphores or any other synchronization primitives to guard ... one number every minute because the I/O could affect the race conditions.
236
views
0 answers
0 votes
Rewrite the program of Fig. $2-23$ to handle more than two processes.
816
views
0 answers
0 votes
Suppose that a university wants to show off how politically correct it is by applying the U.S. Supreme Court's Separate but equal is ... woman_leaves, man_leaves. You may use whatever counters and synchronization techniques you like.
366
views
0 answers
0 votes
Solve the dining philosophers problem using monitors instead of semaphores.
375
views
0 answers
0 votes
Assume that you have an operating system that provides semaphores. Implement a message system. Write the procedures for sending and receiving messages.
209
views
0 answers
0 votes
Write a shell script that produces a file of sequential numbers by reading the last number in the file, adding $1$ to it, and then appending it to the file. Run ... to prevent the race.(Hint: use ln file file.lock to lock the data file.)
321
views
0 answers
0 votes
The readers and writers problem can be formulated in several ways with regard to which category of processes can be started when. Carefully describe three different ... to access the database, and what happens when a process is finished.
200
views
0 answers
0 votes
Consider the procedure put forks in Fig. $2-47$. Suppose that the variable $state[i]$ was set to THINKING after the two calls to test, rather than before. How would this change affect the solution?
197
views
0 answers
0 votes
In the solution to the dining philosophers problem (Fig. $2-47$), why is the state variable set to HUNGRY in the procedure take_forks?
619
views
0 answers
0 votes
Consider a system in which it is desired to separate policy and mechanism for the scheduling of kernel threads. Propose a means of achieving this goal.
1.4k
views
1 answers
0 votes
A real-time system needs to handle two voice calls that each run every $6$ msec and consume $1$ msec of CPU time per burst, plus one video at $25$ frames/sec, with each frame requiring $20$ msec of CPU time. Is this system schedulable?
567
views
0 answers
1 votes
In the dining philosophers problem, let the following protocol be used: An even-numbered philosopher always picks up his left fork before picking up his ... picking up his left fork. Will this protocol guarantee deadlock-free operation?
3.0k
views
2 answers
1 votes
A soft real-time system has four periodic events with periods of $50, 100, 200,$ and $250$ ... , respectively. What is the largest value of $x$ for which the system is schedulable?
2.3k
views
1 answers
1 votes
The aging algorithm with $a = 1/2$ is being used to predict run times. The previous four runs, from oldest to most recent, are $40, 20, 40,$ and $15$ msec. What is the prediction of the next time?
321
views
0 answers
0 votes
For the above problem, can another video stream be added and have the system still be schedulable?