|
From: David C N. <dc...@ad...> - 2004-04-06 19:27:44
|
On Tue, 6 Apr 2004, Lei Zhang wrote: > So you have 768 /3 = 256 sessions in a single process? Can you make > your application host smaller number of sessions? I played a little > with the timeout value of poll() a little a while ago, my purpose then > was to see if that helps reduce the CPU usage of my beepcore-c based > application - and noticed the problem you described in this thread. There are only a few sessions active, though the number will vary somewhat. It would be nice if only active sessions were actually impacting performance, but even better for the number of sessions to not seriously affect performance. > Assume I understand your question, here is an answer: this poll() usally > does not have the WRITE mask set, some other thread will make the WRITE > mask set. However, the mask change won't take effect until poll() times > out, hence any outgoing message may have to wait as long as the poll > timeout value before they get sent out. "3 * pn->size" seems to be a > good timeout value: not too much latency, not too hard on CPU usage. > Otherwise, we need a way to let poll() return whenver a mask for any fd > is changed. Returning right away when a mask is changed might be preferable to having CPU consumption raised by having a very short timeout, or by having multi-millisecond latencies added every time a message sent. Any idea of how to do it? ------------------------------------------------------- -- David C. Niemi Adeptech Systems, Inc. -- -- Reston, Virginia, USA http://www.adeptech.com/ -- ------------------------------------------------------- |