-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOQueues.java
More file actions
42 lines (40 loc) · 802 Bytes
/
IOQueues.java
File metadata and controls
42 lines (40 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class IOQueues {
static IOModuleEntry queues[] ;
static
{
queues = new IOModuleEntry[SystemConfig.numIO+1];
for (int i=0;i<=SystemConfig.numIO;i++)
{
queues[i] = new IOModuleEntry();
}
}
static void addNewProc(Process proc)
{
IOSpec curriospec = (IOSpec)proc.specifications.getFirst();
try
{
queues[curriospec.io_module_num].addNewProcess(proc);
}
catch (Exception e)
{
System.out.println("the io_module that was accessed " + curriospec.io_module_num);
e.printStackTrace();
System.exit(0);
}
}
static void update(int psg)
{
for(int i=0;i<queues.length;i++)
{
try
{
queues[i].update(psg);
}
catch (NullPointerException e)
{
System.out.println("Failed in IOQueues update, i is " + i);
System.exit(0);
}
}
}
}