This commit is contained in:
shadow8t4 2015-11-10 15:49:32 -06:00
parent f4109d605f
commit 4545d514a2
2 changed files with 9 additions and 6 deletions

View file

@ -33,8 +33,6 @@ public:
int get_val(){return b_val;}
void set_b(int b){ b_val = b;}
int get_val(){ return b_val; }
void push(string item);

View file

@ -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;