Placement Algorithm:
It decides which program to load into the memory. Common placement algorithms are first-fit,
next-fit, best-fit and priority fit.
Next-fit often leads to allocation of the largest block at the end of memory
First-fit favors allocation near the beginning: tends to create less fragmentation then Next-fit
Best-fit searches for smallest block: the fragment left behind is small as possible
Main memory quickly forms holes too small to hold any process: compaction generally needs to
be done more often
The following jobs are loaded into memory using fixed partition following a certain memory
allocation method (best-fit, first-fit and worst-fit).
List of Jobs
Size
Turnaround
Job 1
100k
3
Job 2
10k
1
Job 3
35k
2
Job 4
15k
1
Job 5
23k
2
Job 6
6k
1
Job 7
25k
1
Job 8
55k
2
Job 9
88k
3
Job 10
100k
3
Memory Block Size
Block 1 50k
Block 2 200k
Block 3 70k
Block 4 115k
Block 5 15k
BEST FIT
Best-fit memory allocation makes the best use of memory space but slower in making
allocation. In the illustration below, on the first processing cycle, jobs 1 to 5 are submitted and be
processed first. After the first cycle, job 2 and 4 located on block 5 and block 3 respectively and
both having one turnaround are replace by job 6 and 7 while job 1, job 3 and job 5 remain on
their designated block. In the third cycle, job 1 remain on block 4, while job 8 and job 9 replace
job 7 and job 5 respectively (both having 2 turnaround). On the next cycle, job 9 and job 8
remain on their block while job 10 replace job 1 (having 3 turnaround). On the fifth cycle only
job 9 and 10 are the remaining jobs to be process and there are 3 free memory blocks for the
incoming jobs. But since there are only 10 jobs, so it will remain free. On the sixth cycle, job 10
is the only remaining job to be process and finally on the seventh cycle, all jobs are successfully
process and executed and all the memory blocks are now free.
FIRST- FIT
First-fit memory allocation is faster in making allocation but leads to memory waste. The
illustration below shows that on the first cycle, job 1 to job 4 are submitted first while job 6
occupied block 5 because the remaining memory space is enough to its required memory size to
be process. While job 5 is in waiting queue because the memory size in block 5 is not enough for
the job 5 to be process. Then on the next cycle, job 5 replace job 2 on block 1 and job 7 replace
job 4 on block 4 after both job 2 and job 4 finish their process. Job 8 is in waiting queue because
the remaining block is not enough to accommodate the memory size of job 8. On the third cycle,
job 8 replace job 3 and job 9 occupies block 4 after processing job 7. While Job 1 and job 5
remain on its designated block. After the third cycle block 1 and block 5 are free to serve the
incoming jobs but since there are 10 jobs so it will remain free. And job 10 occupies block 2
after job 1 finish its turns. On the other hand, job 8 and job 9 remain on their block. Then on the
fifth.
Web & Social Media Analytics Previous Year Question Paper.pdf
Placement AlgorithmIt decides which program to load into the memo.pdf
1. Placement Algorithm:
It decides which program to load into the memory. Common placement algorithms are first-fit,
next-fit, best-fit and priority fit.
Next-fit often leads to allocation of the largest block at the end of memory
First-fit favors allocation near the beginning: tends to create less fragmentation then Next-fit
Best-fit searches for smallest block: the fragment left behind is small as possible
Main memory quickly forms holes too small to hold any process: compaction generally needs to
be done more often
The following jobs are loaded into memory using fixed partition following a certain memory
allocation method (best-fit, first-fit and worst-fit).
List of Jobs
Size
Turnaround
Job 1
100k
3
Job 2
10k
1
Job 3
35k
2
Job 4
15k
1
Job 5
23k
2
Job 6
6k
1
Job 7
25k
2. 1
Job 8
55k
2
Job 9
88k
3
Job 10
100k
3
Memory Block Size
Block 1 50k
Block 2 200k
Block 3 70k
Block 4 115k
Block 5 15k
BEST FIT
Best-fit memory allocation makes the best use of memory space but slower in making
allocation. In the illustration below, on the first processing cycle, jobs 1 to 5 are submitted and be
processed first. After the first cycle, job 2 and 4 located on block 5 and block 3 respectively and
both having one turnaround are replace by job 6 and 7 while job 1, job 3 and job 5 remain on
their designated block. In the third cycle, job 1 remain on block 4, while job 8 and job 9 replace
job 7 and job 5 respectively (both having 2 turnaround). On the next cycle, job 9 and job 8
remain on their block while job 10 replace job 1 (having 3 turnaround). On the fifth cycle only
job 9 and 10 are the remaining jobs to be process and there are 3 free memory blocks for the
incoming jobs. But since there are only 10 jobs, so it will remain free. On the sixth cycle, job 10
3. is the only remaining job to be process and finally on the seventh cycle, all jobs are successfully
process and executed and all the memory blocks are now free.
FIRST- FIT
First-fit memory allocation is faster in making allocation but leads to memory waste. The
illustration below shows that on the first cycle, job 1 to job 4 are submitted first while job 6
occupied block 5 because the remaining memory space is enough to its required memory size to
be process. While job 5 is in waiting queue because the memory size in block 5 is not enough for
the job 5 to be process. Then on the next cycle, job 5 replace job 2 on block 1 and job 7 replace
job 4 on block 4 after both job 2 and job 4 finish their process. Job 8 is in waiting queue because
the remaining block is not enough to accommodate the memory size of job 8. On the third cycle,
job 8 replace job 3 and job 9 occupies block 4 after processing job 7. While Job 1 and job 5
remain on its designated block. After the third cycle block 1 and block 5 are free to serve the
incoming jobs but since there are 10 jobs so it will remain free. And job 10 occupies block 2
after job 1 finish its turns. On the other hand, job 8 and job 9 remain on their block. Then on the
fifth cycle, only job 9 and job 10 are to be process while there are 3 memory blocks free. In the
sixth cycle, job 10 is the only remaining job to be process and lastly in the seventh cycle, all jobs
are successfully process and executed and all the memory blocks are now free.
WORST-FIT
Worst-fit memory allocation is opposite to best-fit. It allocates free available block to the new
job and it is not the best choice for an actual system. In the illustration, on the first cycle, job 5 is
in waiting queue while job 1 to job 4 and job 6 are the jobs to be first process. After then, job 5
occupies the free block replacing job 2. Block 5 is now free to accommodate the next job which
is job 8 but since the size in block 5 is not enough for job 8, so job 8 is in waiting queue. Then on
the next cycle, block 3 accommodate job 8 while job 1 and job 5 remain on their memory block.
In this cycle, there are 2 memory blocks are free. In the fourth cycle, only job 8 on block 3
remains while job 1 and job 5 are respectively replace by job 9 and job 10. Just the same in the
previous cycle, there are still two free memory blocks. At fifth cycle, job 8 finish its job while
the job 9 and job 10 are still on block 2 and block 4 respectively and there is additional memory
block free. The same scenario happen on the sixth cycle. Lastly, on the seventh cycle, both job 9
and job 10 finish its process and in this cycle, all jobs are successfully process and executed. And
all the memory blocks are now free.
SCAN disk Scheduling Algorithm
In operating systems, seek time is very important. Since all device requests are linked in queues,
the seek time is increased causing the system to slow down. Disk Scheduling Algorithms are
used to reduce the total seek time of any request.
Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk [1].
4. Since seeking disk requests is time consuming, disk scheduling algorithms try to minimize this
latency. If desired disk drive or controller is available, request is served immediately. If busy,
new request for service will be placed in the queue of pending requests. When one request is
completed, the Operating System has to choose which pending request to service next. The OS
relies on the type of algorithm it needs when dealing and choosing what particular disk request is
to be processed next. The objective of
This algorithm is performed by moving the R/W head back-and-forth to the innermost and
outermost track. As it scans the tracks from end to end, it process all the requests found in the
direction it is headed. This will ensure that all track requests, whether in the outermost, middle or
innermost location, will be traversed by the access arm thereby finding all the requests. This is
also known as the Elevator algorithm. Using the same sets of example in FCFS the solution are
as follows:
(THM) = (50-0) + (180-0) = 50 + 180 (THM) = 230 Seek Time = THM * Seek rate = 230 * 5ms
Seek Time = 1,150 ms this algorithm works like an elevator does. In the algorithm example, it
scans down towards the nearest end and when it reached the bottom it scans up servicing the
requests that it did not get going down. If a request comes in after it has been scanned, it will not
be serviced until the process comes back down or moves back up [5]. This process moved a total
of 230 tracks and a seek time of 1,150. This is optimal than the previous algorithm. In operating
systems, seek time is very important. Since all device requests are linked in queues, the seek time
is increased causing the system to slow down. Disk Scheduling Algorithms are used to reduce
the total seek time of any request.
Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk [1].
Since seeking disk requests is time consuming, disk scheduling algorithms try to minimize this
latency. If desired disk drive or controller is available, request is served immediately. If busy,
new request for service will be placed in the queue of pending requests. When one request is
completed, the Operating System has to choose which pending request to service next. The OS
relies on the type of algorithm it needs when dealing and choosing what particular disk request is
to be processed next. The objective of using these algorithms is keeping Head movements to the
amount as possible. The less the head to move, the faster the seek time will be. To see how it
works, the different disk scheduling algorithms will be discussed and examples are also provided
for better understanding on these different algorithms.
Although there are other algorithms that reduce the seek time of all requests, I will only
concentrate on the following disk scheduling algorithms:
First Come-First Serve (FCFS)
Shortest Seek Time First (SSTF)
Elevator (SCAN)
5. Circular SCAN (C-SCAN)
LOOK
C-LOOK
This approach works like an elevator does. It scans down towards the nearest end and then when
it hits the bottom it scans up servicing the requests that it didn't get going down. If a request
comes in after it has been scanned it will not be serviced until the process comes back down or
moves back up. This process moved a total of 230 tracks. Once again this is more optimal than
the previous algorithm, but it is not the best.
Operating System:
Operating System (OS) is the software that manages the sharing of the resources of a computer.
An operating system processes system data and user input, and responds by allocating and
managing tasks and internal system resources as a service to users and programs of the system.
At the foundation of all system software, an operating system performs basic tasks such as
controlling and allocating memory, prioritizing system requests, controlling input and output
devices, facilitating networking and managing file systems. Major Operating Systems include
Microsoft Windows, Sun Solaris, Mac OS, and the UNIX/Linux Family.
The main functions of a modern general purpose operating system is as follows
UserInterface
All graphics based today, the user interface includes the windows, menus and method of
interaction between the user andthe computer. Prior to graphical user interfaces (GUIs), all
operations were performed by typing in commands. Not extincttoday, a command-line interface
is included in all major operating systems, and technical operations are commonlyexecuted from
the command line by programmers and administrators.
Operating systems may support optional interfaces. Although the overwhelming majority of
people work with the defaultinterface, different "shells" offer variations of functionality, and
"skins" provide different appearances.
JobManagement
Job management controls the time and sequence that applications are run. Common in the
mainframe and high-end serverenvironment, IBM's job control language (JCL) was developed
decades ago to schedule the daily work. The execution of shortscripts at specific times
throughout the day is common in Unix/Linux servers. In a desktop environment, batch files can
bewritten to perform a sequence of operations that can be scheduled to start at a given time.
6. TaskManagement
multitasking, which is the ability to simultaneously execute multiple programs, is available in all
operating systems today.Critical in the mainframe and server environment, applications can be
prioritized to run faster or slower depending on theirpurpose. In the desktop world, multitasking
is more often than not "task switching," which keeps applications open so userscan bounce
back and forth among them.
DataManagement
Data management keeps track of the data on the disk or in solid state storage. The application
program deals with data byfile name and a particular location within the file. The operating
system's file system knows where the data are physicallystored (which sectors) and interaction
between the application and operating system is through the programming interface(API). When
an application needs to retrieve or save data, it makes a call to the file system, which is in charge
of opening, reading, writing and closing files.
DeviceManagement
Device management controls peripheral devices by sending them commands in their proprietary
command language. Thesoftware routine that deals with each device is called a "driver," and
the OS requires drivers for each of the peripheralsattached to the computer. When a different
type of peripheral is attached, that device's driver must be added to the operatingsystem if not
previously installed.
Security
Operating systems provide password protection to keep unauthorized users out of the system.
Activity logs are maintained,which may provide time accounting for billing purposes. They also
may provide backup and recovery routines for starting overin the event of a system failure.
List of Jobs
Size
Turnaround
Job 1
100k
3
Job 2
10k
1
Job 3
7. 35k
2
Job 4
15k
1
Job 5
23k
2
Job 6
6k
1
Job 7
25k
1
Job 8
55k
2
Job 9
88k
3
Job 10
100k
3
Solution
Placement Algorithm:
It decides which program to load into the memory. Common placement algorithms are first-fit,
next-fit, best-fit and priority fit.
Next-fit often leads to allocation of the largest block at the end of memory
First-fit favors allocation near the beginning: tends to create less fragmentation then Next-fit
Best-fit searches for smallest block: the fragment left behind is small as possible
Main memory quickly forms holes too small to hold any process: compaction generally needs to
be done more often
The following jobs are loaded into memory using fixed partition following a certain memory
allocation method (best-fit, first-fit and worst-fit).
9. Block 1 50k
Block 2 200k
Block 3 70k
Block 4 115k
Block 5 15k
BEST FIT
Best-fit memory allocation makes the best use of memory space but slower in making
allocation. In the illustration below, on the first processing cycle, jobs 1 to 5 are submitted and be
processed first. After the first cycle, job 2 and 4 located on block 5 and block 3 respectively and
both having one turnaround are replace by job 6 and 7 while job 1, job 3 and job 5 remain on
their designated block. In the third cycle, job 1 remain on block 4, while job 8 and job 9 replace
job 7 and job 5 respectively (both having 2 turnaround). On the next cycle, job 9 and job 8
remain on their block while job 10 replace job 1 (having 3 turnaround). On the fifth cycle only
job 9 and 10 are the remaining jobs to be process and there are 3 free memory blocks for the
incoming jobs. But since there are only 10 jobs, so it will remain free. On the sixth cycle, job 10
is the only remaining job to be process and finally on the seventh cycle, all jobs are successfully
process and executed and all the memory blocks are now free.
FIRST- FIT
First-fit memory allocation is faster in making allocation but leads to memory waste. The
illustration below shows that on the first cycle, job 1 to job 4 are submitted first while job 6
occupied block 5 because the remaining memory space is enough to its required memory size to
be process. While job 5 is in waiting queue because the memory size in block 5 is not enough for
the job 5 to be process. Then on the next cycle, job 5 replace job 2 on block 1 and job 7 replace
job 4 on block 4 after both job 2 and job 4 finish their process. Job 8 is in waiting queue because
the remaining block is not enough to accommodate the memory size of job 8. On the third cycle,
job 8 replace job 3 and job 9 occupies block 4 after processing job 7. While Job 1 and job 5
10. remain on its designated block. After the third cycle block 1 and block 5 are free to serve the
incoming jobs but since there are 10 jobs so it will remain free. And job 10 occupies block 2
after job 1 finish its turns. On the other hand, job 8 and job 9 remain on their block. Then on the
fifth cycle, only job 9 and job 10 are to be process while there are 3 memory blocks free. In the
sixth cycle, job 10 is the only remaining job to be process and lastly in the seventh cycle, all jobs
are successfully process and executed and all the memory blocks are now free.
WORST-FIT
Worst-fit memory allocation is opposite to best-fit. It allocates free available block to the new
job and it is not the best choice for an actual system. In the illustration, on the first cycle, job 5 is
in waiting queue while job 1 to job 4 and job 6 are the jobs to be first process. After then, job 5
occupies the free block replacing job 2. Block 5 is now free to accommodate the next job which
is job 8 but since the size in block 5 is not enough for job 8, so job 8 is in waiting queue. Then on
the next cycle, block 3 accommodate job 8 while job 1 and job 5 remain on their memory block.
In this cycle, there are 2 memory blocks are free. In the fourth cycle, only job 8 on block 3
remains while job 1 and job 5 are respectively replace by job 9 and job 10. Just the same in the
previous cycle, there are still two free memory blocks. At fifth cycle, job 8 finish its job while
the job 9 and job 10 are still on block 2 and block 4 respectively and there is additional memory
block free. The same scenario happen on the sixth cycle. Lastly, on the seventh cycle, both job 9
and job 10 finish its process and in this cycle, all jobs are successfully process and executed. And
all the memory blocks are now free.
SCAN disk Scheduling Algorithm
In operating systems, seek time is very important. Since all device requests are linked in queues,
the seek time is increased causing the system to slow down. Disk Scheduling Algorithms are
used to reduce the total seek time of any request.
Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk [1].
Since seeking disk requests is time consuming, disk scheduling algorithms try to minimize this
latency. If desired disk drive or controller is available, request is served immediately. If busy,
new request for service will be placed in the queue of pending requests. When one request is
completed, the Operating System has to choose which pending request to service next. The OS
relies on the type of algorithm it needs when dealing and choosing what particular disk request is
to be processed next. The objective of
This algorithm is performed by moving the R/W head back-and-forth to the innermost and
outermost track. As it scans the tracks from end to end, it process all the requests found in the
direction it is headed. This will ensure that all track requests, whether in the outermost, middle or
innermost location, will be traversed by the access arm thereby finding all the requests. This is
also known as the Elevator algorithm. Using the same sets of example in FCFS the solution are
11. as follows:
(THM) = (50-0) + (180-0) = 50 + 180 (THM) = 230 Seek Time = THM * Seek rate = 230 * 5ms
Seek Time = 1,150 ms this algorithm works like an elevator does. In the algorithm example, it
scans down towards the nearest end and when it reached the bottom it scans up servicing the
requests that it did not get going down. If a request comes in after it has been scanned, it will not
be serviced until the process comes back down or moves back up [5]. This process moved a total
of 230 tracks and a seek time of 1,150. This is optimal than the previous algorithm. In operating
systems, seek time is very important. Since all device requests are linked in queues, the seek time
is increased causing the system to slow down. Disk Scheduling Algorithms are used to reduce
the total seek time of any request.
Disk scheduling algorithms are used to allocate the services to the I/O requests on the disk [1].
Since seeking disk requests is time consuming, disk scheduling algorithms try to minimize this
latency. If desired disk drive or controller is available, request is served immediately. If busy,
new request for service will be placed in the queue of pending requests. When one request is
completed, the Operating System has to choose which pending request to service next. The OS
relies on the type of algorithm it needs when dealing and choosing what particular disk request is
to be processed next. The objective of using these algorithms is keeping Head movements to the
amount as possible. The less the head to move, the faster the seek time will be. To see how it
works, the different disk scheduling algorithms will be discussed and examples are also provided
for better understanding on these different algorithms.
Although there are other algorithms that reduce the seek time of all requests, I will only
concentrate on the following disk scheduling algorithms:
First Come-First Serve (FCFS)
Shortest Seek Time First (SSTF)
Elevator (SCAN)
Circular SCAN (C-SCAN)
LOOK
C-LOOK
This approach works like an elevator does. It scans down towards the nearest end and then when
it hits the bottom it scans up servicing the requests that it didn't get going down. If a request
comes in after it has been scanned it will not be serviced until the process comes back down or
moves back up. This process moved a total of 230 tracks. Once again this is more optimal than
the previous algorithm, but it is not the best.
Operating System:
Operating System (OS) is the software that manages the sharing of the resources of a computer.
An operating system processes system data and user input, and responds by allocating and
12. managing tasks and internal system resources as a service to users and programs of the system.
At the foundation of all system software, an operating system performs basic tasks such as
controlling and allocating memory, prioritizing system requests, controlling input and output
devices, facilitating networking and managing file systems. Major Operating Systems include
Microsoft Windows, Sun Solaris, Mac OS, and the UNIX/Linux Family.
The main functions of a modern general purpose operating system is as follows
UserInterface
All graphics based today, the user interface includes the windows, menus and method of
interaction between the user andthe computer. Prior to graphical user interfaces (GUIs), all
operations were performed by typing in commands. Not extincttoday, a command-line interface
is included in all major operating systems, and technical operations are commonlyexecuted from
the command line by programmers and administrators.
Operating systems may support optional interfaces. Although the overwhelming majority of
people work with the defaultinterface, different "shells" offer variations of functionality, and
"skins" provide different appearances.
JobManagement
Job management controls the time and sequence that applications are run. Common in the
mainframe and high-end serverenvironment, IBM's job control language (JCL) was developed
decades ago to schedule the daily work. The execution of shortscripts at specific times
throughout the day is common in Unix/Linux servers. In a desktop environment, batch files can
bewritten to perform a sequence of operations that can be scheduled to start at a given time.
TaskManagement
multitasking, which is the ability to simultaneously execute multiple programs, is available in all
operating systems today.Critical in the mainframe and server environment, applications can be
prioritized to run faster or slower depending on theirpurpose. In the desktop world, multitasking
is more often than not "task switching," which keeps applications open so userscan bounce
back and forth among them.
DataManagement
Data management keeps track of the data on the disk or in solid state storage. The application
program deals with data byfile name and a particular location within the file. The operating
system's file system knows where the data are physicallystored (which sectors) and interaction
13. between the application and operating system is through the programming interface(API). When
an application needs to retrieve or save data, it makes a call to the file system, which is in charge
of opening, reading, writing and closing files.
DeviceManagement
Device management controls peripheral devices by sending them commands in their proprietary
command language. Thesoftware routine that deals with each device is called a "driver," and
the OS requires drivers for each of the peripheralsattached to the computer. When a different
type of peripheral is attached, that device's driver must be added to the operatingsystem if not
previously installed.
Security
Operating systems provide password protection to keep unauthorized users out of the system.
Activity logs are maintained,which may provide time accounting for billing purposes. They also
may provide backup and recovery routines for starting overin the event of a system failure.
List of Jobs
Size
Turnaround
Job 1
100k
3
Job 2
10k
1
Job 3
35k
2
Job 4
15k
1
Job 5
23k
2
Job 6
6k
1