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 » Community » U++ community news and announcements » "Raw" thread support
"Raw" thread support [message #35957] Sun, 08 April 2012 19:21
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Primary motivation for this feature was creation of asynchronous DNS resolver IpAddrInfo.

The problem is that there are no easy to use nonblocking APIs for DNS, getaddrinfo is blocking.

The easiest solution to the situation is to use separate thread to perform blocking call. Anyway, I want still to keep single-threaded mode, because some code can run 5-15% faster if compiled single-threaded. This is because in single-threaded mode, most synchronization routines are just NOPs.

Anyway, that does not preclude to have auxiliary threads in single-threaded, if some rules are followed. Basically, if nothing related to U++ heap is used, it should be OK.

It is also worth to encapsulate two basic MT features, StartRawThread and RawMutex, to avoid platform differences. StartRawThread and RawMutex thus exist and work even in single-threaded mode...

To see more details, examine IpAddrInfo.
Previous Topic: Stream public interface cleanup
Next Topic: uppconfig.h and SVO Value now default (and how to switch it off)
Goto Forum:
  


Current Time: Mon Apr 29 00:35:50 CEST 2024

Total time taken to generate the page: 0.04200 seconds