Posted: Fri Oct 31, 2008 2:11 am Post subject: API for C++ on multi-process apps.HELP!!!
Newbie
Joined: 31 Oct 2008 Posts: 4
I'm using MQ API for C++ on AIX.The app is a server,which calls ImqQueue.get to retrieve a message,fork a new child process to deal with it,then send the response to another queue within the child process.but the ImqQueue.send() method always generates 2 other child-processes.The code is like this:
main()
{
m.openConnection();
m.opensendQ("send");
m.openrecvQ("recv");
while(true)
{
string buff = m.recv();
//testsend("hello");
switch(fork())
{
case 0:break;
default:continue;
}
dosomething();
m.send("hello"); //FREEZE!
exit(0);
}
}
if I send "hello" on testsend(),it's ok;but if I send it on m.send(),2 other child-processes are created while no messasge arrives on recvq at all. WHAT's WRONG?? PLEASE!!!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum