Commit 9fc9aa50 authored by Maximilian	Brütt's avatar Maximilian Brütt

NWS Pipe added.

parent 941be7e5
......@@ -60,7 +60,7 @@ public final class WorkStealingPipe<T> extends AbstractSynchedPipe<T> implements
Object obj = this.queue.poll();
if (obj != null) {
return obj;
} else {
} else if (haulSize > 0) {
int index;
WorkStealingPipe<T> victim;
if (busyCheck) {
......@@ -96,6 +96,9 @@ public final class WorkStealingPipe<T> extends AbstractSynchedPipe<T> implements
}
}
return this.queue.poll();
} else {
// haulSize is 0 and we're not permitted to steal:
return null;
}
}
......
......@@ -82,4 +82,12 @@ public class WorkStealingPipeFactory<T> {
return create(source, target, 0, 1, true);
}
/**
* Create a pipe utilizing no work stealing. This pipe is only able to become a victim and no theft will be attempted.
* Mimicks a {@link BoundedSynchedPipe} in behaviour.
*/
public WorkStealingPipe<T> createNWSPipe(final OutputPort<? extends T> source, final InputPort<T> target) {
return create(source, target, 0, 0, false);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment