Question

Operating Systems Concepts Why are special purpose machine instructions inefficient? What are the two most common...

Operating Systems Concepts

  1. Why are special purpose machine instructions inefficient?
  1. What are the two most common techniques, supported by the operating system, that are more efficient solution than special purpose machine instructions?
  1. What are the two general uses of semaphores?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:-

Why are special purpose machine instructions inefficient?

Giving too many instructions at one time.
Failing to make sure that instructions are understood.
Putting too many “don’ts” in instructions instead of stating things more positively.
Giving an insufficient number of instructions

What are the two most common techniques, supported by the operating system, that are more efficient solution than special purpose

1: Processes and Process Management

A process is basically a program in execution. The execution of a process must progress in a sequential fashion. To put it in simple terms, we write our computer programs in a text file, and when we execute this program, it becomes a process which performs all the tasks mentioned in the program.

When a program is loaded into the memory and it becomes a process, it can be divided into four sections ─ stack, heap, text, and data. The following image shows a simplified layout of a process inside main memory

  • Stack: The process Stack contains the temporary data, such as method/function parameters, return address, and local variables.
  • Heap: This is dynamically allocated memory to a process during its run time.
  • Text: This includes the current activity represented by the value of Program Counter and the contents of the processor’s registers.
  • Data: This section contains the global and static variables.

When a process executes, it passes through different states. These stages may differ in different operating systems, and the names of these states are also not standardized. In general, a process can have one of the following five states at a time:

  • Start: The initial state when a process is first started/created.
  • Ready: The process is waiting to be assigned to a processor. Ready processes are waiting to have the processor allocated to them by the operating system so that they can run. A process may come into this state after the Start state, or while running it by but getting interrupted by the scheduler to assign CPU to some other process.
  • Running: Once the process has been assigned to a processor by the OS scheduler, the process state is set to running and the processor executes its instructions.
  • Waiting: the process moves into the waiting state if it needs to wait for a resource, such as waiting for user input, or waiting for a file to become available.
  • Terminated or Exit: Once the process finishes its execution, or it is terminated by the operating system, it is moved to the terminated state where it waits to be removed from main memory.

A Process Control Block is a data structure maintained by the Operating System for every process. The PCB is identified by an integer process ID (PID). A PCB keeps all the information needed to keep track of a process as listed below:

  • Process State: The current state of the process — whether it is ready, running, waiting, or whatever.
  • Process Privileges: This is required to allow/disallow access to system resources.
  • Process ID: Unique identification for each of the processes in the operating system.
  • Pointer: A pointer to the parent process.
  • Program Counter: Program Counter is a pointer to the address of the next instruction to be executed for this process.
  • CPU Registers: Various CPU registers where processes need to be stored for execution for running state.
  • CPU Scheduling Information: Process priority and other scheduling information which is required to schedule the process.
  • Memory Management Information: This includes the information of page table, memory limits, and segment table, depending on the memory used by the operating system.
  • Accounting Information: This includes the amount of CPU used for process execution, time limits, execution ID, and so on.
  • IO Status Information: This includes a list of I/O devices allocated to the process.

2: Threads and Concurrency

A thread is a flow of execution through the process code. It has its own program counter that keeps track of which instruction to execute next. It also has system registers which hold its current working variables, and a stack which contains the execution history.

A thread shares with its peer threads various information like code segment, data segment, and open files. When one thread alters a code segment memory item, all other threads see that.

A thread is also called a lightweight process. Threads provide a way to improve application performance through parallelism. Threads represent a software approach to improving the performance of operating systems by reducing the overhead. A thread is equivalent to a classical process.

Each thread belongs to exactly one process, and no thread can exist outside a process. Each thread represents a separate flow of control. Threads have been successfully used in implementing network servers and web servers. They also provide a suitable foundation for parallel execution of applications on shared memory multiprocessors.

Advantages of threads:

  • They minimize the context switching time.
  • Using them provides concurrency within a process.
  • They provide efficient communication.
  • It is more economical to create and context switch threads.
  • Threads allow utilization of multiprocessor architectures to a greater scale and efficiency.

Threads are implemented in the following two ways:

  • User Level Threads: User-managed threads.
  • Kernel Level Threads: Operating System-managed threads acting on a kernel, an operating system core

What are the two general uses of semaphores?

  • To control access to a shared device between tasks. A printer is a good example. ...
  • Task synchronization. By tasks taking and giving the same semaphore, you can force them to perform operations in a desired order.
Add a comment
Know the answer?
Add Answer to:
Operating Systems Concepts Why are special purpose machine instructions inefficient? What are the two most common...
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
  • a) Provide two most important reasons why active management may not be suitable in an inefficient...

    a) Provide two most important reasons why active management may not be suitable in an inefficient market. Please ensure that you explain each reason in the context of active management rather than investing in that particular market? b) What are the two main actions and/or strategies taken by fund-of-funds Hedge fund managers to increase liquidity? Are there any negative effects of these actions?

  • Each of the Mobile Operating Systems discussed in class—Android, IOS, Windows 8 – use a layered...

    Each of the Mobile Operating Systems discussed in class—Android, IOS, Windows 8 – use a layered architecture. Create a graphic to compare their architectures and discuss any significant differences. What makes a Mobile Operating System special? That is why is it different than other Operating systems? What is the purpose of synchronizing processes? What method of Inter-Process Communication must be used in distributed systems? Given the following code for processes A and B. If process A is scheduled then process...

  • A computer chip manufacturer spent $2,540,000 to develop a special-purpose molding machine. The machine has been...

    A computer chip manufacturer spent $2,540,000 to develop a special-purpose molding machine. The machine has been used for one year and is expected to be obsolete after an additional 3 years. The company uses straight-line (SLN) depreciation for this machine. At the beginning of the second year, a machine salesperson offers a new, vastly more efficient machine. This machine will cost $2,040,000, reduce annual cash manufacturing costs from $1,840,000 to $1,040,000, and have zero disposal value at the end of...

  • ISOM319 Operations Management Instructions:  For each topic (with bullet point) please use one or two sentences to...

    ISOM319 Operations Management Instructions:  For each topic (with bullet point) please use one or two sentences to describe or define the topic , can be as simple as a definition. You may use the book to help you with concepts you may not remember.    Process Analysis ·       Process Flow Diagram ·       Little’s Law: Flow Unit, Flow Rate, Flow Time ·       Inventory Turns, Direct Labor Cost, Productivity, Yield Capacity Management and Analysis ·       Capacity Management ·       Capacity Analysis: Theoretical vs Actual Capacities, Utilization, Process Capacity, Process Flow...

  • Explain what enterprise resource planning (ERP) systems. Outline several of their key characteristics. Describe in reasonable...

    Explain what enterprise resource planning (ERP) systems. Outline several of their key characteristics. Describe in reasonable detail how a company leverages an ERP system and how its operations are improved after installing an ERP system like SAP. Explain how a supply chain management system helps an organization make its operations more efficient What is Upstream and Downstream management of the supply chain? Explain the concept of “Supply Network”, its benefits, and how technology made this concept available Explain the difference...

  • A computer chip manufacturer spent $2,500,000 to develop a special-purpose molding machine. The machine has been used for one year and is expected to be obsolete after an additional 3 years. The comp...

    A computer chip manufacturer spent $2,500,000 to develop a special-purpose molding machine. The machine has been used for one year and is expected to be obsolete after an additional 3 years. The company uses straight-line (SLN) depreciation for this machine At the beginning of the second year, a machine salesperson offers a new, vastly more efficient machine. This machine will cost $2,000,000, reduce annual cash manufacturing costs from $1,800,000 to $1,000,000, and have zero disposal value at the end of...

  • Exercise 6-3 Reconciliation of Absorption and Variable Costing Net Operating Incomes Special instructions: Complete Exercise 6-3...

    Exercise 6-3 Reconciliation of Absorption and Variable Costing Net Operating Incomes Special instructions: Complete Exercise 6-3 in this document after the requirements list. You can create a table for the reconciliation report. Exhibit 6-4 provides an example that should help you complete the exercise. Jorgansen Lighting, Inc., manufactures heavy-duty street lighting systems for municipalities. The company uses variable costing for internal management reports and absorption costing for external reports to shareholders, creditors, and the government. The company has provided the...

  • Four modes vs. two modes of operationg systems (kernel / user)

    The VAX/ VMS operating system makes use of four processor access modes to facili-tate the protection and sharing of system resources among processes. The accessmode determines:• Instruction execution privileges: What instructions the processor may execute• Memory access privileges: Which locations in virtual memory the current instruc-tion may accessThe four modes are as follows:• Kernel: Executes the kernel of the VMS operating system, which includes memo-ry management, interrupt handling, and I/ O operations• Executive: Executes many of the operating system service...

  • For the efficient memory management and to avoid errors modern systems uses secondary memory as a...

    For the efficient memory management and to avoid errors modern systems uses secondary memory as a part of the main memory known as a virtual memory. When a computer system is running serval programs at the same time, the main memory often becomes exhausted. In such circumstances instead of closing some programs the operating system use the secondary memory as part of the main memory to store some data. In short virtual memory is an elegant interaction of hardware exceptions,...

  • Instructions This discussion requires you to synthesize your knowledge about the relationships of health care concepts...

    Instructions This discussion requires you to synthesize your knowledge about the relationships of health care concepts with your knowledge of effective patient teaching techniques. For each discussion you will select ONE Concept Analysis Diagram, the normal physiology of ONE of the interrelated concepts leading to ONE of the consequences (positive or negative). Be sure to limit your discussion to normal physiology. Do not present a disease process or delve into pathophysiology. Your target audience is your patient, so avoid medical...

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