Saturday, February 26, 2011

Job and Process Status

Using the process state diagram, explain why there is no transition:
  • ·       From the READY to WAITING.
  • ·       From the WAITING to RUNNING

      A process goes through a series of discrete process states. Transition is the process through which an existing circumstance, condition, or relationship (real or imagined) is acted on in a manner that produces a new and different circumstance or condition.  When a process is first created, it occupies the “Hold” state. In this state, the process awaits admission to the “Ready” state, as illustrated above. When this admission is approved by the job scheduler, it is then set in the “Ready” state.  Processes that are ready for the CPU are kept in this queue. Also, in this state, there is temporarily no CPU available for it. If there is already an available CPU that may allocate the process, it will lead to a “Running” state. In this state, the process is currently executing on a CPU. When the process or job has already finished execution, it will not be sent to the “Finished” state. In some cases, a process or job is put into the “Waiting” state if it requests an external event to be executed such as an I/O request. Also, a transition between “Running” and “Ready” state occurs when the scheduler decides that the running process has long enough and it is time to let another process have a CPU time. The transition between “Waiting” and “Ready” state occurs when the external event the process or job has been waiting finally happened then it will be signalled to continue processing through the “Ready” state. And the cycle goes on. 

FROM THE READY TO WAITING

      A job or process in the “Ready” queue will soon make use of the CPU. A job or process in the “Waiting” queue is waiting for an input that is not yet available. So when a job in the Ready queue fails to continue because it needs a device that will enable it to perform in the Running state, it will not proceed to the Waiting queue but instead it will go back to the “Hold” state. This is because it will again wait for an admission from the CPU that it is ready enough to be processed. 

FROM THE WAITING TO RUNNING

      When a job or process in the Waiting state was given the event for it continue executing, it will first go to the Ready state before it is processed as with the Running State. This is because, processes entering the system must go initially into the Ready state and processes can only enter the Running state via the Ready state. Bypassing or obstructing the Ready queue will not make a successful performance of the process management.
 
 

Fixed Partitioning

Loading jobs into memory using fixed partition following a certain memory allocation method. (a. best-fit, b. first-fit, c. worst-fit).

BEST - FIT

1st Turnaround
2nd Turnaround
3rd Turnaround
4th Turnaround
5th Turnaround
6th Turnaround
7th Turnaround
Size
Job 3 (35 k)
Job 3 (35 k)
FREE
FREE
FREE
FREE
FREE
50 k
Job 5 (23 k)
Job 5 (23 k)
Job 9 (88 k)
Job 9 (88 k)
Job 9 (88 k)
FREE
FREE
200k
Job 4 (15 k)
Job 7 (25 k)
Job 8 (55 k)
Job 8 (55 k)
FREE
FREE
FREE
70 k
Job 1(100 k)
Job 1(100 k)
Job 1(100 k)
Job10(100k)
Job10(100k)
Job10(100k)
FREE
115k
Job 2 (15 k)
Job 6 (6 k)
FREE
FREE
FREE
FREE
FREE
15 k


In Best Fit, the allocator places a process in the smallest block of unallocated memory in which it will fit. 

FIRST - FIT

1st Turnaround
2nd Turnaround
3rd Turnaround
4th Turnaround
5th Turnaround
6th Turnaround
7th Turnaround
Size
Job 2 (15 k)
Job 5 (23 k)
Job 5 (23 k)
FREE
FREE
FREE
FREE
50 k
Job1(100 k)
Job1(100 k)
Job1(100 k)
Job10(100k)
Job10(100k)
Job10(100k)
FREE
200k
Job 3 (35 k)
Job 3 (35 k)
Job 8 (55 k)
FREE
FREE
FREE
FREE
70 k
Job 4(15 k)
Job 7(25 k)
Job 9(88 k)
Job 9(88 k)
FREE
FREE
FREE
115k
Job 6 (6 k)
FREE
FREE
FREE
FREE
FREE
FREE
15 k 

In First Fit, it simply scans the free list until a large enough hole is found. Despite the name, first-fit is generally better than best-fit because it leads to less fragmentation.

WORST - FIT

1st Turnaround
2nd Turnaround
3rd Turnaround
4th Turnaround
5th Turnaround
6th Turnaround
7th Turnaround
Size
Job 4 (15 k)
Job 7 (25 k)
FREE
FREE
FREE
FREE
FREE
50 k
Job 1(200 k)
Job 1(200 k)
Job 1(200 k)
Job 9 (88 k)
Job 9 (88 k)
Job 9 (88 k)
FREE
200k
Job 3 (35 k)
Job 3 (35 k)
Job  (55 k)
FREE
FREE
FREE
FREE
70 k
Job 2 (10 k)
Job 5 (23 k)
Job 5 (23 k)
Job10(100k)
Job10(100k)
Job10(100k)
Job10(100k)
115k
Job 6 (6 k)
FREE
FREE
FREE
FREE
FREE
FREE
15 k

In Worst Fit, the memory places processes in the largest block unallocated memory available. The idea is that this placement will create the largest hole after the allocations, thus increasing the possibility that, compared to best fit, another process can use the hole created as a result of external fragmentation.

Dynamic and Relocatable Dynamic Partitioning

Dynamic Partitioning
      In dynamic partitioning, the partitions are of variable length and number. When a process is loaded, it is allocated exactly as much memory as it requires. In the illustration above, the size of the entire memory is 220 k. The operating system has 15 k leaving 205 k of memory space. On the first turnaround, jobs 1 to 6 were loaded to the memory leaving 16 k of memory space which is not suitable for the allocation of job 7 which has a size of 25 k or the job 8 which has a size 55 k, job 9 which has a size of 88 k and job 10 which has a size of 100 k. They are settled in the waiting list because there is no block that will allocate the jobs. On the second turnaround, jobs 2,4 and 6 ended leaving four blocks of free memory space, a block of 10 k, 15 k, 6 k and the remaining 16 k from the first turnaround. Job 7 is still in the waiting list because it will not fit in the free blocks. On the third turnaround, jobs 3 and 5 ended letting job 7 to be allocated at the free memory block of 35 k. The block was now split into two having a free memory block of 10 k. Jobs 8, 9, and 10 are still waiting for a free block that will allocate them. On the fourth turnaround, jobs 1 and 7 ended letting job 8 to be allocated on the free block of 100 k. Still, jobs 9 and 10 are on the waiting list because there are no free blocks that can allocate them. Only job 8 was catered by the memory leaving 6 free blocks. On the fifth turnaround, job 8 was still processed by the memory. While on the sixth turnaround where job 8 ended, there are no free blocks that can allocate the remaining 2 jobs because the main memory becomes fragmented and memory use declines. Job 9 has a size of 88 k so there is no block that can accommodate it, same with job 10 which has a size of 100 k. This phenomenon that the memory external to all partitions becomes increasingly fragmented is called external fragmentation. And the remedy for this is compaction using the Relocatable Dynamic Partition. 

Relocatable Dynamic Partitioning

      The memory size of the illustration above is 220 k with allocated OS of 15 k. There are 10 jobs to be loaded to the memory using relocatable dynamic partition. We have loaded only 6 of the 10 jobs to the memory because there is not enough space for the rest of the jobs to be processed. At the 1st turnaround, Job 2, 4, and 6 ended leaving a block of 10 k after Job 1, a block of 15 k after Job 3, and a block of 22 k after Job 5. When processes finish and new processes are brought in, the main memory becomes more and more fragmented, and memory use declines. To be able to load the remaining jobs to the memory, there must be a block that will allocate the incoming jobs that will fit their sizes. The remedy for this will be Compaction. With compaction, the OS shifts the processes so that the memory left is contiguous in one large block. Jobs 3 and 5 were relocated to gather all of the empty blocks. The empty blocks were compacted to make one block of memory large enough to accommodate some of the jobs waiting to get in. In fig. (c), Job 7 was accommodated because the free size already is 173 letting Job 7 to be processed in the memory. A block of 22 k was left after Job 7 was allocated in the memory. The block will not be able to accommodate Job 8 and the rest so they will have to wait. On the 2nd turnaround, Jobs 3, 5, and 7 ended leaving a block of 105 k for Job 8 only. Job 8 has 55 k of size that will fit in the block of Job 9 has 88 k so it will not be accommodated by the remaining size. Job 9 has to wait. Job 1 is still processed because it has occupied a size of 100 k. On the 3rd turnaround, Job 1 ended letting Job 9 to get in and leaving a block of 12 k to be unattended. Job 10 has to wait because even Jobs 9 and 8 will be compacted, there will still be no enough block of memory that will fit the size of Job 10. When Job 8 ended on the 4th turnaround, Job 10 occupied the block of 100 k. All of the jobs were accomplished because relocatable dynamic partitioning helps in accommodating all of the jobs that the main memory must process.


 

Security Problems with Multiprogramming and Time-Sharing Environment

In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. 
These are the following:

      To lower the cost of of providing computing capability, time-sharing and multiprogramming made it possible for individuals and organizations to use ocmputer without owning one (such as in Internet Cafes, laborities in school, etc.). It also promotes the interactive sense of using computers.
 (1.)
      Let us state some computer laboratories in schools as an instance. Because users share the system simultaneously, they have the opportunity to copy other user's file from the system. Once a user saves a file to his/her unit, other users of that group or connected system may also have an access to the file. Other users may change an information inside the file or even steal the file from the owner itself without the owner knowing it. They may also modify the files or programs that was saved or ran by the owner. Furthermore, some of the threats that the owner of a certain file may encounter is the data confidentiality. Without him not being aware of the system used as the time-sharing and multiprogramming, he may insert or have a secret or confidential data that he wants to remain at the file. Another one is the data integrity. Other users may change, add, or even remove some information in the file if he wants to.
(2.)
      Internet cafes also have a multiprogramming and time-sharing environment. Some internet cafes have hardwares like printers that is also connected with the system. State that a certain user is asking the attendant to print a certain file form his unit. The file now is being printed. There comes this another user that accidentally hit the print button and clicked OK, so the file is being processed to be printed. The result is, it will interrupt the current printing process . It will cause the printer to mix output in printing the data because the other user is now accidentally printing his own file. Because they also share system resources, it will interrupt other current processing files.


Can we ensure the same degree of security in a time-share machine as we have in a dedicated machine?

      A time-share machine is interactive and is used by many users and performs different functions or tasks while a dedicated machine's purpose is to serve one primary function or task. We can not ensure the same degree of security because they are used in different ways and since human's security protection can be also hacked, broked, or damaged by others, it will be more difficult to for users to know the right usage and controls of the machines. For example, an automobile which is a dedicated machine will have its own level of security because it's usage is dedicated solely to the navigation of the car which is not the same with the time-shared machines which can be accessed by others if and only if the authority or the main system implements a certain security for the protection of the files.





Usage of Handheld Computers to Professionals

How will these professionals use handheld computer in their work?

1.) A delivery person for courier service.

      A delivery person's job is to bring mails, packages, printed news, etc., to recipients. It must be safe and on time. It must be free from damages and received on the expected time and date. To be hired as a delivery person in a company or even small time businesses, he must be aware of the directions in his place or his designtard area. But what if you will be sent to a remote area and you are not familiar with the place? How will you deal with it?
      Mapping devices are a major help for cases like these. In a handheld computer, there are map features that will aide your problem in locations. With these features and abilities all pact in a hadheld computer, a delivery person will easily find your area and destination. A major advantage is that it is a compact device that you can use anywhere and everywhere. It doesn't need a lot of electricity. Maybe for charging before use but that is easy to deal with. It is easy to use and helpful to the demand of delivery persons.

2.) A newsreporter.

      Handheld journalism is a threat to the newspaper industry. This kind of journalism is spreading across the globe and may soon conquer the printed news field. Handheld journalism uses handheld computers in order to deliver the information and news. But the newspaper industry may also make use of these hadheld computers for better delivery. 
      A newspaper reporter researches and provides information in printed form. But for better and easier compilation of news and witnessed events, you can use handheld computers to transfer news form the event's area to the newspaper company. In that way, you are able to send an information from the faster speed of time without even giving effort in running or transporting just to deliver the news. Newspaper reporter may also use handheld computers as an editor of their stories and gathered facts. Instead of using a lot of scratch to form your storyline, you can use these devices to help you in editing in no time and less waste of papers. Thus, handheld computers may also aide the demand of the people for faster delivery of reports.