First time here? Checkout the FAQ!
0 votes
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 ago in Operating System by (121 points)   | 21 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 ago by (181 points)  
edited ago by

Related questions

+1 vote
1 answer
asked in Operating System by shebya nautiyal (167 points)   | 45 views
+1 vote
1 answer
asked in Operating System by vaishali jhalani Boss (6k points)   | 135 views

Top Users Jun 2017
  1. Bikram

    3694 Points

  2. Hemant Parihar

    1484 Points

  3. junaid ahmad

    1432 Points

  4. Arnab Bhadra

    1372 Points

  5. Niraj Singh 2

    1311 Points

  6. Rupendra Choudhary

    1194 Points

  7. rahul sharma 5

    1114 Points

  8. Arjun

    930 Points

  9. srestha

    922 Points

  10. Debashish Deka

    896 Points

Monthly Topper: Rs. 500 gift card
Top Users 2017 Jun 19 - 25
  1. Bikram

    1950 Points

  2. Niraj Singh 2

    1306 Points

  3. junaid ahmad

    502 Points

  4. sudsho

    410 Points

  5. akankshadewangan24

    388 Points

23,353 questions
30,061 answers
28,378 users