t
This commit is contained in:
parent
f4109d605f
commit
4545d514a2
2 changed files with 9 additions and 6 deletions
|
@ -34,8 +34,6 @@ public:
|
|||
|
||||
void set_b(int b){ b_val = b;}
|
||||
|
||||
int get_val(){ return b_val; }
|
||||
|
||||
void push(string item);
|
||||
|
||||
string pop();
|
||||
|
|
|
@ -109,12 +109,17 @@ int main(int argc, char * argv[]) {
|
|||
|
||||
string channel_name;
|
||||
for(int i=0; i < w; i++){
|
||||
channel_name = chan.send_request("newthrread");
|
||||
channel_name = chan.send_request("newthread");
|
||||
cout << "\nChan: " << channel_name << endl;
|
||||
RequestChannel* worker_ret = new RequestChannel(channel_name, RequestChannel::CLIENT_SIDE);
|
||||
Worker_Thread(argv, worker_ret);
|
||||
pid = fork();
|
||||
if(pid != 0) {
|
||||
Worker_Thread(argv, worker_ret);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
chan.send_request("quit");
|
||||
|
||||
}
|
||||
|
@ -130,7 +135,7 @@ void* Worker_Thread(char* arg[], RequestChannel* chan){
|
|||
//control chan("control", RequestChannel::CLIENT_SIDE);
|
||||
//string channel_name = control.send_request("newthread");
|
||||
//RequestChannel * channel_ret = new RequestChannel(channel_name, RequestChannel::CLIENT_SIDE);
|
||||
while(Request_Buffer->get_val() != 0){
|
||||
while(true){
|
||||
|
||||
string req = Request_Buffer->pop();
|
||||
cout << "Request: " << req << endl;
|
||||
|
|
Reference in a new issue