Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
So, what is next? Can we enable some sort of profiling to see what is going on?

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
Mediocre result... let me create a java equivalent program so we have a direct comparison.. These are the tests for a similar program in java. bombardier -c 200 -n 1 http://localhost:8081 Bombarding http://localhost:8081/ with 1 requests using 200 connections 1 / 1

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
Result: bombardier -c 200 -n 1 http://localhost: Bombarding http://localhost: with 1 requests using 200 connections 1 / 1 [===] 100.00% 1m24s Done!

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
On Thursday, 16 November 2017 at 18:44:11 UTC, Daniel Kozak wrote: It works for me because I have multiple threads, but when I use only one thread per pool (defaultPoolThreads(1)), it obviosly blocks, which is correct behavior Ok, let me force the: "defaultPoolThreads(8)" and let me

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
On Thursday, 16 November 2017 at 18:20:36 UTC, Daniel Kozak wrote: Hmm works ok for me. What OS? Dne 16. 11. 2017 12:05 dop. napsal uživatel "kdevel via Digitalmars-d-learn" : [...] I'm running MacOS..

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-16 Thread ade90036 via Digitalmars-d-learn
On Wednesday, 15 November 2017 at 23:04:46 UTC, kdevel wrote: On Wednesday, 15 November 2017 at 13:31:46 UTC, Daniel Kozak wrote: This one works ok for me, but I am on linux: https://dpaste.dzfl.pl/f54decee45bc It works, but it does not handle two connects in parallel. STR: 1. start the

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-15 Thread ade90036 via Digitalmars-d-learn
So thanks for the suggestions, i have fixed HTTP response not postman cal also parse the headers correctly!! happy days. I have removed the duration from the Socket.select but the application seems to process a bunch or requests and then it stalls for several seconds (3/5) and then it

Re: NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-15 Thread ade90036 via Digitalmars-d-learn
On Tuesday, 14 November 2017 at 21:09:40 UTC, kdevel wrote: 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?

NIO+Multithreaded TCPSocket listener, very low cpu utilisation

2017-11-14 Thread ade90036 via Digitalmars-d-learn
Hi Forum, Let's cut the chase, i'm a newby in Dlang. I have 15+ years experience in java and 7+ years experience in C++. I found D very fascinating and the sugar coated syntax very appealing to my style of coding. (groovy like) I've been trying to learn Dland and bring it thought the

Re: rawRead using a struct with variable leght

2017-06-07 Thread ade90036 via Digitalmars-d-learn
On Monday, 5 June 2017 at 16:30:53 UTC, Era Scarecrow wrote: On Monday, 5 June 2017 at 16:04:28 UTC, ade90036 wrote: Unfortunately the struct doesn't know at compile time what the size of the constant_pool array, or at-least was not able to specify it dynamically. It also won't know ahead

rawRead using a struct with variable leght

2017-06-05 Thread ade90036 via Digitalmars-d-learn
Hi everyone, I'm trying out Dland, always been and have been a big fan. So to give it a good run i wanted to create is a java class parser, based on the spec released here. ( https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html.) The class file can be represented in the following