Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
croft1
floodlight
Commits
4a97a0c3
Commit
4a97a0c3
authored
11 years ago
by
meiyangbigswitch
Browse files
Options
Downloads
Patches
Plain Diff
add debug info
parent
ca2bcddb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/net/floodlightcontroller/flowcache/PriorityPendingQueue.java
+7
-8
7 additions, 8 deletions
.../floodlightcontroller/flowcache/PriorityPendingQueue.java
with
7 additions
and
8 deletions
src/main/java/net/floodlightcontroller/flowcache/PriorityPendingQueue.java
+
7
−
8
View file @
4a97a0c3
package
net.floodlightcontroller.flowcache
;
import
java.util.concurrent.
Array
BlockingQueue
;
import
java.util.concurrent.
Linked
BlockingQueue
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.concurrent.locks.Condition
;
import
java.util.concurrent.locks.ReentrantLock
;
/**
* PriorityPendingQueue class - This class is a variant implementation for PriorityBlockingQueue
* PriorityBlockingQueue implementation has two problems:
...
...
@@ -25,9 +24,9 @@ import java.util.concurrent.locks.ReentrantLock;
*
*/
public
class
PriorityPendingQueue
<
E
>
{
private
Array
BlockingQueue
<
E
>
highPriorityQueue
;
private
Array
BlockingQueue
<
E
>
mediumPriorityQueue
;
private
Array
BlockingQueue
<
E
>
lowPriorityQueue
;
private
Linked
BlockingQueue
<
E
>
highPriorityQueue
;
private
Linked
BlockingQueue
<
E
>
mediumPriorityQueue
;
private
Linked
BlockingQueue
<
E
>
lowPriorityQueue
;
private
final
AtomicInteger
count
=
new
AtomicInteger
(
0
);
private
final
ReentrantLock
takeLock
=
new
ReentrantLock
();
private
final
Condition
notEmpty
=
takeLock
.
newCondition
();
...
...
@@ -40,9 +39,9 @@ public class PriorityPendingQueue<E> {
LOW
,
}
public
PriorityPendingQueue
()
{
highPriorityQueue
=
new
Array
BlockingQueue
<
E
>(
1000
);
mediumPriorityQueue
=
new
Array
BlockingQueue
<
E
>(
1000
);
lowPriorityQueue
=
new
Array
BlockingQueue
<
E
>(
5000
);
highPriorityQueue
=
new
Linked
BlockingQueue
<
E
>();
mediumPriorityQueue
=
new
Linked
BlockingQueue
<
E
>();
lowPriorityQueue
=
new
Linked
BlockingQueue
<
E
>();
capacity
=
Integer
.
MAX_VALUE
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment