GATE CSE
First time here? Checkout the FAQ!
x
0 votes
36 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 (149 points) 1 3 11 | 36 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 Active (1.1k points) 1 3 7
edited by


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
Top Users Oct 2017
  1. Arjun

    23438 Points

  2. Bikram

    17108 Points

  3. Habibkhan

    8354 Points

  4. srestha

    6314 Points

  5. Debashish Deka

    5458 Points

  6. jothee

    5008 Points

  7. Sachin Mittal 1

    4882 Points

  8. joshi_nitish

    4390 Points

  9. sushmita

    3996 Points

  10. Rishi yadav

    3840 Points


Recent Badges

Popular Question sunil sarode
Verified Human nandisrinivas
Nice Question shraddha priya
Popular Question just_bhavana
Famous Question rahul sharma 5
Popular Question Jithin Jayan
Great Answer Sankaranarayanan P.N
Good Question jothee
Great Answer Sankaranarayanan P.N
Famous Question pC
27,346 questions
35,200 answers
84,230 comments
33,327 users