Мы поможем в написании ваших работ!



ЗНАЕТЕ ЛИ ВЫ?

Advantages of Multiple Threads

Поиск

 

l The bakery algorithm satisfies deadlock freedom and first-come-first-served and those properties implies starvation freedom

1. 1)Aprocess is:

– A program in execution

– An instance of a running program

– The entity that can be assigned to and executed on a processor

– A single sequential thread of execution, a current state, and an associated set of system resources.

Process states which characterize the behaviour of processes. ( new ready running blocked exit)

 

6.I am not sure!

Chained Allocation

• Allocation on basis of individual block

• Each block contains a pointer to the next block in the chain

• Only single entry in the file allocation table

– Starting block and length of file

• No external fragmentation

• Best for sequential files

 

7 Process:

· An executing instance of a program is called a process.

· Some operating systems use the term ‘task‘ to refer to a program that is being executed.

· A process is always stored in the main memory also termed as the primary memory or random access memory.

· Therefore, a process is termed as an active entity. It disappears if the machine is rebooted.

· Several process may be associated with a same program.

· On a multiprocessor system, multiple processes can be executed in parallel.

· On a uni-processor system, though true parallelism is not achieved, a process scheduling algorithm is applied and the processor is scheduled to execute each process one at a time yielding an illusion of concurrency.

· Example: Executing multiple instances of the ‘Calculator’ program. Each of the instances are termed as a process.

Thread:

· A thread is a subset of the process.

· It is termed as a ‘lightweight process’, since it is similar to a real process but executes within the context of a process and shares the same resources allotted to the process by the kernel (See kquest.co.cc/2010/03/operating-system for more info on the term ‘kernel’).

· Usually, a process has only one thread of control – one set of machine instructions executing at a time.

· A process may also be made up of multiple threads of execution that execute instructions concurrently.

· Multiple threads of control can exploit the true parallelism possible on multiprocessor systems.

· On a uni-processor system, a thread scheduling algorithm is applied and the processor is scheduled to run each thread one at a time.

· All the threads running within a process share the same address space, file descriptor, stack and other process related attributes.

Benefits

  • Takes less time to create a new thread than a process
  • Less time to terminate a thread than a process
  • Switching between two threads takes less time that switching processes
  • Threads can communicate with each other
    • without invoking the kernel

8. The disk-scheduling algorithm should be written as a separate module of the operating system – Allowing it to be replaced with a different algorithm if necessary• Either SSTF or LOOK is a reasonable choice for the default algorithm.

  • Improved responsiveness — When it comes to application performance I am a firm believer that perception is reality. If the user perceives that my application is slow, then it that means it is in reality slow. If the application is performing operations that take a perceivably long time to complete, these operations can be put into a separate thread which will allow the application to continue to be responsive to the user.
  • Faster application — Multiple threads can lead to improved application performance. For example, if there are a number of calculations to be performed or the contents of a file are being processed, then there the application can be made faster by performing multiple operations at the same time.
  • Prioritization — Threads can be assigned a priority which would allow higher priority tasks to take precedence over lower priority tasks.


Поделиться:


Последнее изменение этой страницы: 2024-06-27; просмотров: 4; Нарушение авторского права страницы; Мы поможем в написании вашей работы!

infopedia.su Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав. Обратная связь - 18.191.189.124 (0.009 с.)