Is it a problem to create more than one channel for one thread?
The reason is that I think that it’s sometimes easier to have a channel with its own MsgReceive() in some functions to just receive pulses triggered by timers, for example. Just because local variables without any signification outside the dedicated function have to be global in other hand.
This question because it seems to be a problem in fact!
In case, just do it!
int chid, rcvid;
attach = name_attach(NULL, “testChannel”, 0);
rcvid = MsgReceive(attach->chid, NULL, 0, NULL);
chid = ChannelCreate(0);
printf(“chid %d\n”, chid);
MsgReply(rcvid, 0, NULL, 0);
fd = name_open(“testChannel”, 0);
MsgSend(fd, NULL, 0, NULL, 0);
if you launch clientChannel many times, you will see chid increasing until fatal value!!