GATE CSE
First time here? Checkout the FAQ!
x
0 votes
30 views
We know each process has its process table which have process ID, PC, priority, list of open files etc etc... Now if we have two process A and B.. OS issues process A to the processor.. process A starts its execution and it open a file.. After this process context switch and process B get a chance.. Process B closes the file which process A has opened..

Now what will happen..?

Will there be a change in entries in process table of process A.. what will happen when process A will resume its execution..
asked in Operating System by (137 points)   | 30 views

1 Answer

0 votes
This problem somewhat resemble with reader- writer problem of critical section ..

In your case both process are trying to access the same file , first process A after opening it preempted so the file and its bookmarks all are save in context of that process now second process is also trying to open it .

So for that we have two cases here..

First , if that file has read and write facility then access to that file will be mutually exclusive ( means at one time only one process can access it ) ...

Second , if that file has only read facility then any no. Of process can access it simultaneously ...( i.e.In your case both process trying to access same file)..

Now if process B closes the file then it is for his context ... not for process A ..

Process A still have it bookmarks to that file save in its context...
answered by (433 points)  
edited by

Related questions

+1 vote
1 answer
2
asked in Operating System by shebya nautiyal (167 points)   | 45 views
+1 vote
1 answer
3
asked in Operating System by vaishali jhalani Boss (6.1k points)   | 188 views


Top Users Aug 2017
  1. Bikram

    5174 Points

  2. ABKUNDAN

    4730 Points

  3. akash.dinkar12

    3504 Points

  4. manu00x

    3492 Points

  5. rahul sharma 5

    3188 Points

  6. makhdoom ghaya

    2700 Points

  7. just_bhavana

    2432 Points

  8. stblue

    2244 Points

  9. Tesla!

    2090 Points

  10. pawan kumarln

    1874 Points


25,065 questions
32,220 answers
75,083 comments
30,231 users