author | wenzelm |
Tue, 21 Jul 2009 15:25:22 +0200 | |
changeset 32099 | 5382c93108db |
parent 32093 | 30996b775a7f |
child 32101 | e25107ff4f56 |
permissions | -rw-r--r-- |
28165 | 1 |
(* Title: Pure/Concurrent/task_queue.ML |
2 |
Author: Makarius |
|
3 |
||
4 |
Ordered queue of grouped tasks. |
|
5 |
*) |
|
6 |
||
7 |
signature TASK_QUEUE = |
|
8 |
sig |
|
29340 | 9 |
type task |
29121 | 10 |
val new_task: int -> task |
11 |
val pri_of_task: task -> int |
|
28196 | 12 |
val str_of_task: task -> string |
29340 | 13 |
type group |
32052 | 14 |
val group_id: group -> int |
29340 | 15 |
val eq_group: group * group -> bool |
28165 | 16 |
val new_group: unit -> group |
32099 | 17 |
val group_exns: group -> exn list |
28179 | 18 |
val str_of_group: group -> string |
28165 | 19 |
type queue |
20 |
val empty: queue |
|
28204 | 21 |
val is_empty: queue -> bool |
32052 | 22 |
val status: queue -> {ready: int, pending: int, running: int} |
29121 | 23 |
val enqueue: group -> task list -> int -> (bool -> bool) -> queue -> task * queue |
29365 | 24 |
val extend: task -> (bool -> bool) -> queue -> queue option |
25 |
val dequeue: queue -> (task * group * (bool -> bool) list) option * queue |
|
32055
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
26 |
val dequeue_towards: task list -> queue -> |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
27 |
(((task * group * (bool -> bool) list) * task list) option * queue) |
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
28 |
val interrupt: queue -> task -> unit |
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
29 |
val interrupt_external: queue -> string -> unit |
32099 | 30 |
val cancel_group: group -> exn -> unit |
29340 | 31 |
val cancel: queue -> group -> bool |
32 |
val cancel_all: queue -> group list |
|
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
33 |
val finish: task -> queue -> queue |
28165 | 34 |
end; |
35 |
||
29340 | 36 |
structure Task_Queue:> TASK_QUEUE = |
28165 | 37 |
struct |
38 |
||
29121 | 39 |
(* tasks *) |
40 |
||
41 |
datatype task = Task of int * serial; |
|
42 |
fun new_task pri = Task (pri, serial ()); |
|
28165 | 43 |
|
29121 | 44 |
fun pri_of_task (Task (pri, _)) = pri; |
45 |
fun str_of_task (Task (_, i)) = string_of_int i; |
|
28998 | 46 |
|
29121 | 47 |
fun task_ord (Task t1, Task t2) = prod_ord (rev_order o int_ord) int_ord (t1, t2); |
31971
8c1b845ed105
renamed functor TableFun to Table, and GraphFun to Graph;
wenzelm
parents:
31632
diff
changeset
|
48 |
structure Task_Graph = Graph(type key = task val ord = task_ord); |
28165 | 49 |
|
28998 | 50 |
|
29121 | 51 |
(* groups *) |
52 |
||
32099 | 53 |
datatype group = Group of serial * exn list ref; |
32052 | 54 |
|
55 |
fun group_id (Group (gid, _)) = gid; |
|
29340 | 56 |
fun eq_group (Group (gid1, _), Group (gid2, _)) = gid1 = gid2; |
28551 | 57 |
|
32099 | 58 |
fun new_group () = Group (serial (), ref []); |
29121 | 59 |
|
32099 | 60 |
fun group_exns (Group (_, ref exns)) = exns; |
28165 | 61 |
|
32099 | 62 |
fun str_of_group (Group (i, ref exns)) = |
63 |
if null exns then string_of_int i else enclose "(" ")" (string_of_int i); |
|
28179 | 64 |
|
28165 | 65 |
|
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
66 |
(* jobs *) |
28165 | 67 |
|
68 |
datatype job = |
|
29365 | 69 |
Job of (bool -> bool) list | |
28165 | 70 |
Running of Thread.thread; |
71 |
||
29121 | 72 |
type jobs = (group * job) Task_Graph.T; |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
73 |
|
29121 | 74 |
fun get_group (jobs: jobs) task = #1 (Task_Graph.get_node jobs task); |
75 |
fun get_job (jobs: jobs) task = #2 (Task_Graph.get_node jobs task); |
|
29365 | 76 |
fun set_job task job (jobs: jobs) = Task_Graph.map_node task (fn (group, _) => (group, job)) jobs; |
28202
23cb9a974630
added focus, which indicates a particular collection of high-priority tasks;
wenzelm
parents:
28196
diff
changeset
|
77 |
|
29121 | 78 |
fun add_job task dep (jobs: jobs) = |
79 |
Task_Graph.add_edge (dep, task) jobs handle Task_Graph.UNDEF _ => jobs; |
|
29117
5a79ec2fedfb
tuned enqueue: plain add_edge, acyclic not required here;
wenzelm
parents:
28998
diff
changeset
|
80 |
|
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
81 |
|
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
82 |
(* queue of grouped jobs *) |
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
83 |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
84 |
datatype result = Unknown | Result of task | No_Result; |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
85 |
|
28165 | 86 |
datatype queue = Queue of |
28184
5ed5cb73a2e9
eliminated cache, access queue efficiently via IntGraph.get_first;
wenzelm
parents:
28179
diff
changeset
|
87 |
{groups: task list Inttab.table, (*groups with presently active members*) |
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
88 |
jobs: jobs, (*job dependency graph*) |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
89 |
cache: result}; (*last dequeue result*) |
28165 | 90 |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
91 |
fun make_queue groups jobs cache = Queue {groups = groups, jobs = jobs, cache = cache}; |
28204 | 92 |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
93 |
val empty = make_queue Inttab.empty Task_Graph.empty No_Result; |
29121 | 94 |
fun is_empty (Queue {jobs, ...}) = Task_Graph.is_empty jobs; |
28165 | 95 |
|
96 |
||
32052 | 97 |
(* status *) |
98 |
||
99 |
fun status (Queue {jobs, ...}) = |
|
100 |
let |
|
101 |
val (x, y, z) = |
|
102 |
Task_Graph.fold (fn (task, ((_, job), (deps, _))) => fn (x, y, z) => |
|
103 |
(case job of |
|
104 |
Job _ => if null deps then (x + 1, y, z) else (x, y + 1, z) |
|
105 |
| Running _ => (x, y, z + 1))) |
|
106 |
jobs (0, 0, 0); |
|
107 |
in {ready = x, pending = y, running = z} end; |
|
108 |
||
109 |
||
28185
0f20cbce4935
simplified dequeue: provide Thread.self internally;
wenzelm
parents:
28184
diff
changeset
|
110 |
(* enqueue *) |
28165 | 111 |
|
31632 | 112 |
fun enqueue (group as Group (gid, _)) deps pri job (Queue {groups, jobs, cache}) = |
28165 | 113 |
let |
29121 | 114 |
val task = new_task pri; |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
115 |
val groups' = Inttab.cons_list (gid, task) groups; |
28185
0f20cbce4935
simplified dequeue: provide Thread.self internally;
wenzelm
parents:
28184
diff
changeset
|
116 |
val jobs' = jobs |
29365 | 117 |
|> Task_Graph.new_node (task, (group, Job [job])) |> fold (add_job task) deps; |
31632 | 118 |
val cache' = |
119 |
(case cache of |
|
120 |
Result last => |
|
121 |
if task_ord (last, task) = LESS |
|
122 |
then cache else Unknown |
|
123 |
| _ => Unknown); |
|
124 |
in (task, make_queue groups' jobs' cache') end; |
|
28165 | 125 |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
126 |
fun extend task job (Queue {groups, jobs, cache}) = |
29365 | 127 |
(case try (get_job jobs) task of |
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
128 |
SOME (Job list) => SOME (make_queue groups (set_job task (Job (job :: list)) jobs) cache) |
29365 | 129 |
| _ => NONE); |
130 |
||
28185
0f20cbce4935
simplified dequeue: provide Thread.self internally;
wenzelm
parents:
28184
diff
changeset
|
131 |
|
0f20cbce4935
simplified dequeue: provide Thread.self internally;
wenzelm
parents:
28184
diff
changeset
|
132 |
(* dequeue *) |
0f20cbce4935
simplified dequeue: provide Thread.self internally;
wenzelm
parents:
28184
diff
changeset
|
133 |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
134 |
fun dequeue (queue as Queue {groups, jobs, cache}) = |
29121 | 135 |
let |
29365 | 136 |
fun ready (task, ((group, Job list), ([], _))) = SOME (task, group, rev list) |
29121 | 137 |
| ready _ = NONE; |
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
138 |
fun deq boundary = |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
139 |
(case Task_Graph.get_first boundary ready jobs of |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
140 |
NONE => (NONE, make_queue groups jobs No_Result) |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
141 |
| SOME (result as (task, _, _)) => |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
142 |
let |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
143 |
val jobs' = set_job task (Running (Thread.self ())) jobs; |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
144 |
val cache' = Result task; |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
145 |
in (SOME result, make_queue groups jobs' cache') end); |
29121 | 146 |
in |
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
147 |
(case cache of |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
148 |
Unknown => deq NONE |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
149 |
| Result last => deq (SOME last) |
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
150 |
| No_Result => (NONE, queue)) |
28384
70abca69247b
dequeue_towards: return bound for unfinished tasks;
wenzelm
parents:
28332
diff
changeset
|
151 |
end; |
28202
23cb9a974630
added focus, which indicates a particular collection of high-priority tasks;
wenzelm
parents:
28196
diff
changeset
|
152 |
|
28165 | 153 |
|
32055
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
154 |
(* dequeue_towards -- adhoc dependencies *) |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
155 |
|
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
156 |
fun dequeue_towards deps (queue as Queue {groups, jobs, ...}) = |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
157 |
let |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
158 |
fun ready task = |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
159 |
(case Task_Graph.get_node jobs task of |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
160 |
(group, Job list) => |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
161 |
if null (Task_Graph.imm_preds jobs task) then SOME (task, group, rev list) |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
162 |
else NONE |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
163 |
| _ => NONE); |
32093
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
164 |
|
32055
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
165 |
val tasks = filter (can (Task_Graph.get_node jobs)) deps; |
32093
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
166 |
fun result (res as (task, _, _)) = |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
167 |
let |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
168 |
val jobs' = set_job task (Running (Thread.self ())) jobs; |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
169 |
val cache' = Unknown; |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
170 |
in (SOME (res, tasks), make_queue groups jobs' cache') end; |
32055
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
171 |
in |
32093
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
172 |
(case get_first ready tasks of |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
173 |
SOME res => result res |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
174 |
| NONE => |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
175 |
(case get_first ready (Task_Graph.all_preds jobs tasks) of |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
176 |
SOME res => result res |
30996b775a7f
tuned dequeu_towards: try immediate tasks before expensive all_preds;
wenzelm
parents:
32055
diff
changeset
|
177 |
| NONE => (NONE, queue))) |
32055
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
178 |
end; |
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
179 |
|
6a46898aa805
recovered a version of dequeue_towards (cf. bb7b5a5942c7);
wenzelm
parents:
32052
diff
changeset
|
180 |
|
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
181 |
(* sporadic interrupts *) |
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
182 |
|
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
183 |
fun interrupt (Queue {jobs, ...}) task = |
28551 | 184 |
(case try (get_job jobs) task of SOME (Running thread) => SimpleThread.interrupt thread | _ => ()); |
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
185 |
|
29121 | 186 |
fun interrupt_external (queue as Queue {jobs, ...}) str = |
187 |
(case Int.fromString str of |
|
188 |
SOME i => |
|
31617
bb7b5a5942c7
simplified join_results: no longer work "towards" deps, which simplifies task queue management and maintains strict bottom up discipline (without "transfer of priority" to required futures);
wenzelm
parents:
29365
diff
changeset
|
189 |
(case Task_Graph.get_first NONE |
29121 | 190 |
(fn (task as Task (_, j), _) => if i = j then SOME task else NONE) jobs |
191 |
of SOME task => interrupt queue task | NONE => ()) |
|
192 |
| NONE => ()); |
|
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
193 |
|
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
194 |
|
29340 | 195 |
(* termination *) |
28165 | 196 |
|
32099 | 197 |
fun cancel_group (Group (_, r)) exn = CRITICAL (fn () => |
198 |
(case exn of |
|
199 |
Exn.Interrupt => if null (! r) then r := [exn] else () |
|
200 |
| _ => change r (cons exn))); |
|
201 |
||
28551 | 202 |
fun cancel (Queue {groups, jobs, ...}) (group as Group (gid, _)) = |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
203 |
let |
32099 | 204 |
val _ = cancel_group group Exn.Interrupt; |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
205 |
val tasks = Inttab.lookup_list groups gid; |
29342 | 206 |
val running = fold (get_job jobs #> (fn Running t => insert Thread.equal t | _ => I)) tasks []; |
28551 | 207 |
val _ = List.app SimpleThread.interrupt running; |
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
208 |
in null running end; |
28165 | 209 |
|
29340 | 210 |
fun cancel_all (Queue {jobs, ...}) = |
211 |
let |
|
212 |
fun cancel_job (group, job) (groups, running) = |
|
32099 | 213 |
(cancel_group group Exn.Interrupt; |
29342 | 214 |
(case job of Running t => (insert eq_group group groups, insert Thread.equal t running) |
29340 | 215 |
| _ => (groups, running))); |
216 |
val (groups, running) = Task_Graph.fold (cancel_job o #1 o #2) jobs ([], []); |
|
217 |
val _ = List.app SimpleThread.interrupt running; |
|
218 |
in groups end; |
|
219 |
||
31632 | 220 |
fun finish task (Queue {groups, jobs, cache}) = |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
221 |
let |
28190
0a2434cf38c9
cancel: invalidate group implicitly, via bool ref;
wenzelm
parents:
28185
diff
changeset
|
222 |
val Group (gid, _) = get_group jobs task; |
28176
01b21886e7f0
job: explicit 'ok' status -- false for canceled jobs;
wenzelm
parents:
28171
diff
changeset
|
223 |
val groups' = Inttab.remove_list (op =) (gid, task) groups; |
29121 | 224 |
val jobs' = Task_Graph.del_node task jobs; |
31632 | 225 |
val cache' = |
226 |
if null (Task_Graph.imm_succs jobs task) then cache |
|
227 |
else Unknown; |
|
228 |
in make_queue groups' jobs' cache' end; |
|
28165 | 229 |
|
230 |
end; |