Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cf-dev] Potential problem due to lack of fairness in thread scheduling? ( Re: Sender thread does not seem to function while setting the timeout to very small value)

Hi Abhijan,

 

I’m not sure, what you want to test, if you set the response timeout to 1 ms.

And from the few lines, I can only guess what happens.

 

You may have a look at the threading architecture of californium:

There some stages, using decoupled daemon threads, e.g. CoapEndpoint using an Executor,

or UDPConnector using Receiver or Sender thread).

So, if you send a request from you main-thread, it hands over the work to such daemon threads.

If you now wait “very short”, I guess your main-thread exits without waiting for the daemon threads.

I can only guess this, because your example is very, very reduced. If my guess is right, then you may

Not see something going out. But this is “working as designed” if you use a staging with daemon threads.

If you want to see something sent even with a 1ms response timeout, you may just sleep for a while before

Exit the main-thread. But even that doesn’t make too much sense, because I would not sent something

without being interested in a response.

 

So I can’t see a good reason for such a low response timeout nor shutdown a client that fast.

 

Mit freundlichen Grüßen / Best regards

 

Achim Kraus

 

Bosch Software Innovations GmbH

Communications (INST/ECS4)

Stuttgarter Straße 130

71332 Waiblingen

GERMANY

www.bosch-si.de

www.blog.bosch-si.com

 

Registered office: Berlin, Register court: Amtsgericht Charlottenburg, HRB 148411 B

Executives: Dr.-Ing. Rainer Kallenbach; Michael Hahn

 

 

 

 

 

 

 

 


Back to the top