-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathclient.java
More file actions
37 lines (29 loc) · 749 Bytes
/
client.java
File metadata and controls
37 lines (29 loc) · 749 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
package concurrentDemos;
import java.util.concurrent.Executor;
public class client implements Runnable {
private concurrQueue crq;
public client(concurrQueue cq)
{
this.crq=cq;
}
@Override
public void run() {
// TODO Auto-generated method stub
boolean stopcondition = (crq.getQueuSize()==0);
while(!stopcondition)
{
for(int i=0;i<crq.getQueuSize();i++)
{
System.out.println("Client wants to deque item" + crq.dequeItem());
try {
Thread.sleep(1300);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
stopcondition = crq.getQueuSize()==0;
}
System.out.println("Client Process exiting...");
}
}
}