Lorin Ahmed

Forum Replies Created

Viewing 7 posts - 51 through 57 (of 57 total)
    1. Lorin Ahmed
      Member

      You can use the formulae told by Ajay or you can think as follows:
      3 user processes reqiuring 2 units of resource each. Meaning 3*2=6 resources will always suffice. But is it the minimum?? Lets try with 5..
      If we have R=5, then 2 of the 3 process can hold their total requiremnt of 2 units, and 1 unit will be still remaining, which can be acquired by the 3rd process, now 3rd process will wait for another unit to get free. But since the other two processes have already got their 2 units, they can complete and release their resources, as soon as they complete, 4 resources will be freed and 3rd process can take any 1 of the 4 newly freed resources, and this way 3rd can also complete. So R=5 is alaso, but again, is it the minimum??
      Letstry with 4… If each of the 3 process are holding 1 resource, their will be 1 recource left which any of the 3 can acquire and complete its execution and release its 2 units of resources, then the other two also complete… So 4 is the minimum R till now.
      Lets try with R=3, IF each process is holding 1 resource then all the 3 units will be helded by some process and their will be no more units left, now each process will wait for 1 more resource to complete, which they will never get because of the hold and wait condition.. Thus 3 units of resource wont suffice here.
      Thus 4 is the right answer.
      Lol, If u r unable to understand this logic u can use the formulae as well.. i knew m bad at explaining things πŸ˜€

    1. Lorin Ahmed
      Member

      Thanx Ajay, You teached us such a simple formulae for solving this kinda question.. Actually, i find it difficult to memorize formulae’s thats why i try to solve most of the questions by logic. Anyways it depends on person to person. πŸ™‚

    1. Lorin Ahmed
      Member

      Dont worry Vineet, i have the same problem which you have, I am giving Gate forum’s mock test series, have given 4 so far and consistently scoring 46-49, lol no more no less… But u knw, as far as myself is concerned, after each paper, i learn something new, Gateforum ppl make paper of enough difficulty level and they ask question never been asked b4 in gate, so when i encounter them in the mock test, i may fail to answer some of them correctly, but after the paper i can study all the concepts needed to solve that question at home.. So this increments my knowledge, but again in the next mock test, they ask something new again, which again makes me study about that, Yes i worry sometimes about my non-increasing score in the tests, but i know that after giving 12 such tests, I’ll know much more and will be prepared much more than b4..
      Vineet, what you score in mock tests doesnt matter, but what you learn after giving them matters,, thats what mock tests are for.. So dnt leave the question which you are unable to answer in the tests till you become able to solve such questions if ever asked again. πŸ™‚

    1. Lorin Ahmed
      Member

      I answered your question in the other thread anusha. πŸ™‚

    1. Lorin Ahmed
      Member

      And guys please ask more doubts in this community, i love asking and clearing doubts..

    1. Lorin Ahmed
      Member

      @ Anusha,
      Your Ques:A computer has 6 tape drives with N process competing for them.. each process need 2 drives… then the max value for N to b deadlock free is??????

      Answer: first of all we need to know that what causes a deadlock?? When several process hold their resources and wait for more resources for completion, we cannot preempt the resources they hold hold unless they complete…But the resources they are waiting for are held by some other process which are again waiting for some resource which are held by some other process, and when this form a cycle… We can be sure that all the process will keep on waiting for the resources which are already held by some other resource and thus, All of the process will wait forever and Thus DEADLOCKED.

      The Ques says there are total of 6 tape drives(resource) and n processes where each require 2 drives… thus for the system to be deadlock free, the total no. of process should not be such that it forms a hold and wait cycle… Suppose we have max n=6 i.e. 6 process then, what can happen is each process holding 1 drive and waiting for the 2nd drive to complete execution, but since no extra drive is left, and no process will pre empt the resource they are holding b4 they complete, all the process will wait forever and thus will be in deadlock… While if we take max n=5 , In the worst situation each process will have 1 tape drive but still there will be an extra tape drive left, which any of the 5 process can use and complete releasing both of the tape drives it needed… Thus the system will never go into deadlock… So the answer of your question is
      n=5.

      I m bad in explaining things, i tried my best.. Hope you understood. πŸ™‚

    1. Lorin Ahmed
      Member

      @ Manisha, to know if some grammer is finite or infinite, you jst need to have a look at the production rules, if there is any recursive production then the grammer is infinite. for example a production like..
      S—> Sab|a
      You can producing S again and againby this production infinitely.
      Hope i answered your question. πŸ™‚

Viewing 7 posts - 51 through 57 (of 57 total)