[zeromq-dev] Poller.Poll CPU utilization.

Ilya Kazovsky kazovsky at wesee.com
Thu Jul 11 13:18:48 CEST 2013


 

 

From: Maxim Terletsky [mailto:terletsky at wesee.com] 
Sent: Thursday, July 11, 2013 2:17 PM
To: 'Ilya Kazovsky'
Subject: RE: Ненужное письмо, т.к. см предыдущее.

 

Hi all,

I'm using 0MQ in C#. In a separate thread I run:

[code]

poller = new Poller( new[] { socket } );            

while( !token.IsCancellationRequested )

{

poller.Poll( timeout );

}

[/code]

This thread utilizes 100% CPU and it doesn't matter what timeout I pass to
the Poller.Poll.

Is there a possibility to poller.Poll wait for the socket event without
utilzation of the CPU?

 

I also tried 

[code]

poller = new Poller( new[] { socket } );            

while( !token.IsCancellationRequested )

{

poller.Poll( timeout );

Thread.Sleep(1);

}

[/code]

 

It's better but still eating a lot of CPU. Is there another way?

---

Yours faithfully, Ilya.

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20130711/fcbb4ad9/attachment.htm>


More information about the zeromq-dev mailing list