Question

In a multithreaded environment, there is still a single process control block, but now there are...

In a multithreaded environment, there is still a single process control block, but now there are also separate control blocks for each thread. The thread control block contains register values.

i) What other information is stored in the thread control block?

ii) Why are the register values stored in the thread control blocks as opposed to the process control block given that the machine has a single set of registers?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

i) The thread control block contains the thread's Register Values, other than register values the TCB also contains:

  1. Thread Identifier: It is a unique ID assigned to every new thread.
  2. Stack Pointer.
  3. Program Counter: Stores the pointer to current program instruction.
  4. State of the thread (running, ready, waiting, start, done).
  5. Pointer to the PCB of parent process of the thread.

ii) Threads of the same process can run concurrently, this is made feasible because each thread have its own context. So in order to preserve this context the thread have to maintain its own resources that is independent of other threads. This information is stored in Register set and the stack.

To be more precise, the threads of the same process running o the same CPU actually share the same registers. The OS switches context so frequently and instantaneously that it gives an illusion that the threads are running parallel to each other. When context switching happens the registers are backed up and the back up that was made of the other thread is restored. Hence, the system behaves as if threads were using separate registers, even though they are not.

Add a comment
Know the answer?
Add Answer to:
In a multithreaded environment, there is still a single process control block, but now there are...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 9.- ( 11 points) Draw a diagram showing the ELF(object code), Process Control Block, Thread Control...

    9.- ( 11 points) Draw a diagram showing the ELF(object code), Process Control Block, Thread Control Blocks and the run-time environment for a program with three threads, indicating how these data structures are related. Use arrows to show all relationships.

  • What is a process control block? What kind of values does it store? When are the...

    What is a process control block? What kind of values does it store? When are the times it is used? What is an equivalent model for threads? 2)Group 1 contains some CPU scheduling algorithms and Group 2 contains some applications. Match entries in Group 1 to entries in Group 2. Give a brief explanation of your matching criteria. Group l (P) Shortest Job First Scheduling Group II (1) Thread Scheduling (2) Static Process (Q) Process Contention Scope (PCS) and System...

  • Debugging and testing multithreaded programs is made more difficult compared to dealing with single-threaded programs by...

    Debugging and testing multithreaded programs is made more difficult compared to dealing with single-threaded programs by: 1. the necessity to divide activities into separate and concurrent tasks 2. the existence of many more different execution paths made possible by parallel thread execution 3. multithreading library APIs with confusing semantics -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Consider the following code that creates N threads using the POSIX threading library. The thread function threadFun receives as parameter a thread index (from 0 to N-1). #define NTHREADS 4...

  • EMULATE A PROCESS CONTROL BLOCK In this assignment you will use Java, Python or C++ to...

    EMULATE A PROCESS CONTROL BLOCK In this assignment you will use Java, Python or C++ to create a process control block. All objects described aren’t provided, you will create them. You can divide up this code into separate files or put all code in one file. Proper documentation is essential, if there are no comments 5% of the total grade will be deducted. The process control block object PCB should have the following fields: ID: a unique ID for this...

  • Description In this homework, you are asked to implement a multithreaded program that will allow ...

    Description In this homework, you are asked to implement a multithreaded program that will allow us to measure the performance (i.e, CPU utilization, Throughput, Turnaround time, and Waiting time in Ready Queue) of the four basic CPU scheduling algorithms (namely, FIFO, SJE PR, and RR). Your program will be emulating/simulating the processes whose priority, sequence of CPU burst time(ms) and I'O burst time(ms) will be given in an input file. Assume that all scheduling algorithms except RR will be non-preemptive,...

  • Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for...

    Question 4: Single Cycle Datapath Control (15 points) We wish to add the hardware support for a special R-type instruction jlr Jump and Link Register) to the single-cycle datapath below. Though this is an R-type instruction, but it is a special one that has the opcode being 000001 (instead of 000000), so the control unit will be able to differentiate this jlr instruction from the other R-type instructions and generate a special set of controls for this instruction. Opcode rs...

  • You will use Quartus II to build an 8 bit arithmetic logic unit that performs the...

    You will use Quartus II to build an 8 bit arithmetic logic unit that performs the following functions: Control Value Function                                000 Copy In1 to theResult unchanged 001 Copy In2 to theResult unchanged 010 Add In1 to In2 011 Subtract In2 from In1 100 And In1 and In2 101 Or In1 and In2 110 Shift left In1 by 1 bit 111 Shift right In1 by 1 bit You are allowed to use either gates/logic schematic, or else Verilog. We suggest...

  • 1. Identify weaknesses in the current accounts receivable process to include potential fraudulent activity due to the lack of formalized procedures in the accounts receivables process. 2.What are your recommendations to improve the control environment an

    Richie was the Controller at Ralph Malph Enterprises (RME), a publicly-traded sales supported company. He started the job six months ago and after observing the activities in his area, he determined that the accounts receivables procedures needed to be tightened up. He approached Marion, the Accounts Receivable clerk, requesting her assistance in documenting the procedures related to new customer approvals, credit limits, and cash receipts. Marion indicated that there were no formal procedures for approving new customers—she received names and...

  • 1. Set up three-sigma control limits with the given data. Determine the following: a. The center...

    1. Set up three-sigma control limits with the given data. Determine the following: a. The center line of the chart b. Lower and upper control limits c. Develop a p chart 2. Is the process in control? If the observations are within control limits, does that guarantee that the process variation contains only randomness? 3. Based on your analysis what is the problem? 4. What advice would you give to Larraine based on the information that you now have? 5....

  • Question 2 (10 points) (quality.py): We are provided with data from a quality control process in...

    Question 2 (10 points) (quality.py): We are provided with data from a quality control process in a manufacturing firm. The data file, "data.csv", contains several measurements. Each measurement is written in a separate line and each line contains two elements, the area where the measurement is made, and the measured value. These two values are separated with a comma (.). We are tasked to process this data in the following forms. a. First, we need to read the data from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT