Operating Systems | Set 6

• Difficulty Level : Hard
• Last Updated : 27 Mar, 2017

Following questions have been asked in GATE 2011 CS exam.

1) A thread is usually defined as a ‘light weight process’ because an operating system (OS) maintains smaller data structures for a thread than for a process. In relation to this, which of the followings is TRUE?
(A) On per-thread basis, the OS maintains only CPU register state
(B) The OS does not maintain a separate stack for each thread
(C) On per-thread basis, the OS does not maintain virtual memory state
(D) On per thread basis, the OS maintains only scheduling and accounting information.

2) Let the page fault service time be 10ms in a computer with average memory access time being 20ns. If one page fault is generated for every 10^6 memory accesses, what is the effective access time for the memory?
(A) 21ns
(B) 30ns
(C) 23ns
(D) 35ns

Let P be the page fault rate
Effective Memory Access Time = p * (page fault service time) +
(1 - p) * (Memory access time)
= ( 1/(10^6) )* 10 * (10^6) ns +
(1 - 1/(10^6)) * 20 ns
= 30 ns (approx)

3) An application loads 100 libraries at startup. Loading each library requires exactly one disk access. The seek time of the disk to a random location is given as 10ms. Rotational speed of disk is 6000rpm. If all 100 libraries are loaded from random locations on the disk, how long does it take to load all libraries? (The time to transfer data from the disk block once the head has been positioned at the start of the block may be neglected)
(A) 0.50s
(B) 1.50s
(C) 1.25s
(D) 1.00s

Since transfer time can be neglected, the average access time is sum of average seek time and average rotational latency. Average seek time for a random location time is given as 10 ms. The average rotational latency is half of the time needed for complete rotation. It is given that 6000 rotations need 1 minute. So one rotation will take 60/6000 seconds which is 10 ms. Therefore average rotational latency is half of 10 ms, which is 5ms.

Average disk access time = seek time + rotational latency
= 10 ms + 5 ms
= 15 ms
For 100 libraries, the average disk access time will be 15*100 ms

4. Consider the following table of arrival time and burst time for three processes P0, P1 and P2.

Process   Arrival time   Burst Time
P0            0 ms          9 ms
P1            1 ms          4 ms
P2            2 ms          9 ms

The pre-emptive shortest job first scheduling algorithm is used. Scheduling is carried out only at arrival or completion of processes. What is the average waiting time for the three processes?
(A) 5.0 ms
(B) 4.33 ms
(C) 6.33 ms
(D) 7.33 ms
{"ft_lang_label":"__label__en","ft_lang_prob":0.89771324,"math_prob":0.97143877,"size":3416,"snap":"2022-05-2022-21","text_gpt3_token_len":907,"char_repetition_ratio":0.120164126,"word_repetition_ratio":0.012618297,"special_character_ratio":0.27956674,"punctuation_ratio":0.084165476,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9626454,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-01-26T17:51:10Z\",\"WARC-Record-ID\":\"<urn:uuid:72f56a35-6bf2-46fd-bf17-4d6ffb3d6529>\",\"Content-Length\":\"136386\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:54197e9c-1841-4bf7-b388-7104e6875f0a>\",\"WARC-Concurrent-To\":\"<urn:uuid:85580fdc-50f6-4e7a-b527-f32516f6f98c>\",\"WARC-IP-Address\":\"44.228.100.190\",\"WARC-Target-URI\":\"https://origin.geeksforgeeks.org/operating-systems-set-6/\",\"WARC-Payload-Digest\":\"sha1:UOQFOPKUEJPXCTGEGW36FRMN3MY6ZAZE\",\"WARC-Block-Digest\":\"sha1:WE5JUMMM4NSZNIXTARKR4F256VVQ7NNB\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-05/CC-MAIN-2022-05_segments_1642320304959.80_warc_CC-MAIN-20220126162115-20220126192115-00245.warc.gz\"}"}