Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » Question about PostCallback from Child Thread
Re: Question about PostCallback from Child Thread [message #10517 is a reply to message #10516] Fri, 13 July 2007 18:10 Go to previous messageGo to previous message
kfeng is currently offline  kfeng
Messages: 18
Registered: July 2007
Location: Tokyo, Japan
Promising Member
luzr wrote on Fri, 13 July 2007 17:31

Well, two more hints:

- you can also consider whether you should process these data to something else before posting to avoid breaking "get" and "release" library calls into two thread. If not, I think you whould have a lock for the whole library used, you can never say what is going on inside....

- also, this does not sound like a compelling case for multithreading....



According to documentation the server on the other side of the library will just continuing to queue prices until your next read.

Now that I understand MT a little bit more, you got me thinking some more. I am currently using a blocking version of the function call to grab prices, but a non-blocking one is also available.

I used to think blocking is always better, but now, I wonder if it is more efficient to poll every second using the non-blocking call in a non-MT app. I think your supposition is right - that the non-blocking will be fast enough that it shouldn't impact user experience in the GUI. A good example would be an application to view your portfolio's profit & loss - don't care if it's a second late.

However, if latency is important enough that you don't want to set a timer, like an algorithmic black-box for automated trading, then blocking + MT is probably better. But most likely greater latency will show up in other parts of the system, but since it's cumulative, it could be better to squeeze as much as you can out of it. You've opened my eyes again...

I will try both ways next week in the office...

- Ken

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: "Suicide Buttons Array" or how to re-index callbacks or...?
Next Topic: How to use callback with 3 parameters
Goto Forum:
  


Current Time: Mon May 06 20:24:58 CEST 2024

Total time taken to generate the page: 0.02498 seconds