Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TeeTime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
95
Issues
95
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TeeTime
TeeTime
Commits
9fc9aa50
Commit
9fc9aa50
authored
Jan 21, 2017
by
Maximilian Brütt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NWS Pipe added.
parent
941be7e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
WorkStealingPipe.java
src/main/java/teetime/framework/pipe/WorkStealingPipe.java
+4
-1
WorkStealingPipeFactory.java
.../java/teetime/framework/pipe/WorkStealingPipeFactory.java
+8
-0
No files found.
src/main/java/teetime/framework/pipe/WorkStealingPipe.java
View file @
9fc9aa50
...
...
@@ -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
;
}
}
...
...
src/main/java/teetime/framework/pipe/WorkStealingPipeFactory.java
View file @
9fc9aa50
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment