Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I have multiple threads. Each thread receives data and sends to client an acknowledge packet. Each thread takes aprox. 531ms from start to finish. While capturing packets with wireshark.

I was expecting to see a lesser than 1 sec interval between receiving packet and sending packet. The problem is that I see packets from other communications between other devices that are communicating with the same socket but with a different virtual socket number.

Because of this in-between communications the interval between receive and sending packet is aprox 15 seconds.

enter image description here

[16:44:18]No.1073 - when device connects to server on port 7300 and sends data

[16:44:27]No.7535 - when acknowledge is sent to device

elapsed time = 9 seconds.

In those 9 seconds I see in wireshark other communications with other devices. I have timed the thread code that reads and sends ack and it takes less that one second.

Why does it take 9 seconds and not only the time of thread code(milliseconds)? The other threads have impact in this time?

share|improve this question
    
this post is rather hard to read (wall of text). Would you mind editing it into a better shape? –  gnat Oct 7 '13 at 15:58
    
sorry I've just edited. Is it better now? :) –  ThelmaJay Oct 7 '13 at 16:54
    
I have multiple threads. dl.dropboxusercontent.com/u/31910411/code.txt (server code).dl.dropboxusercontent.com/u/31910411/code2.txt (thread code). –  ThelmaJay Oct 7 '13 at 17:01
    
I'm not familiar with your socket-reading tech. Are you sure it does what you think it does? Otherwise, how's your CPU usage? If the other packets are using it all up, they will delay the thread that interests you. Only other thing I can think of is that your thread-creation loop has a 1 second sleep in it. If that loop does less than you (and I) think, it might have to run a few times to create the thread you're interested in. I'd put in more trace message to be sure the program is doing what you think. –  RalphChapin Oct 7 '13 at 19:30
2  
This question appears to be off-topic because it is a request to interpret profiling results. –  GlenH7 Oct 21 '14 at 13:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.