NIO+Multithreaded TCPSocket listener, very low cpu utilisation

kdevel kdevel at vogtner.de
Tue Nov 14 21:09:40 UTC 2017


On Tuesday, 14 November 2017 at 19:57:54 UTC, ade90036 wrote:

>         while(true) {
>             listeningSet.add(listener);
>             if (Socket.select(listeningSet, null, null, 
> dur!"nsecs"(150)) > 0) {

Why do you ever timeout? This loop consumes 100 % (a single core) 
when idle on my machine.




More information about the Digitalmars-d-learn mailing list