This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Is there a production ready lock-free queue or hash implementation in C++
I am looking for a well-tested, publicly available C/C++ implementation of a lock free queue.
I need at least multiple-producers/single-consumer functionality. Multiple-consumers is even better, if exists.
I'm targetting VC's _Interlocked... intrinsics, though anything which is straight forward to port would be fine.
Could anyone give any pointers?
If you're ok to go down that route, there's always the Windows thread pool.
Related
This question already has an answer here:
Callback for phone contacts modification
(1 answer)
Closed 8 years ago.
In Windows Mobile I could use RegistryNotifyCallback and get notified when certain data changed.
Is there any equivalent to this function in Windows Phone 8?
Since RegistryNotifyCallback was used in C++ (unmanaged code) and WP uses .Net (managed code), is there any way to directly import and use the necessary C++ DLLs?
The functionality I'm looking for here is to get notified if a Contact from my People Hub changes any of its data, outside my application. I've asked this question before and the short answer was "the is no way of doing this", but I'm still hoping there is.
I've asked this question before and the short answer was "the is no way of doing this",
Why are you asking again then? It's still the same answer. And we don't have any intentions, whatsoever, to allow 3rd party developers to access data from limited contact stores.
This question already has answers here:
Where can I get windows.h for Mac?
(3 answers)
Closed 4 months ago.
Is there any equivalent to windows.h for mac?
I've been googling it but I can't find anything.
I don't know if it matters but I am currently using Mountain Lion.
There is no direct equivalent. That is, no file for file substitute. It's a different platform after all. You will simply have to work with their API. And without knowing exactly what it is you want to do and what functionality you intend to use, it's hard to provide any additional information.
There is the Carbon API. Or better said, there was. Specifically since Mountain Lion, this API has been deprecated. The aforementioned link mentions some alternatives to deprecated functionality, though the Objective-C route might be a more easily manageable alternative.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Do I need to protect read access to an STL container in a multithreading environment?
I am using the C++ standard library which comes with (Linux) GCC or (Windows) VC.
Can anyone please say clearly whether or not this library is thread safe?
"Thread safe" is not a clearly-defined boolean property of a library. Some things can be done concurrently and others cannot.
Almost certainly if you were to ask a more detailed question specifying what it is you want to do, the answer would be "no, it is not thread-safe". But only almost.
If by "thread-safe" you mean something like the difference between Vector and ArrayList in Java, then C++ standard containers are non-thread-safe.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Get the IP Address of local computer
I want to be able to get the IP address for the machine I'm on in C++ without querying external www.whatsmyip.com, but also want to do it in a platform-independent way. I can find specific examples for both Windows and Linux, but can't think of an easy way to do this in a platform-independent way. I would also consider options of putting an if-statement in depending on the Operating System if this seems like the best/only method.
If you are able to use boost, I highly recommend the boost::asio, which is about as cross-platform as you're going to get.
An alternative to boost::asio may be the POCO Network Library.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
High resolution timer with C++ and Linux?
double hires_time_in_seconds();
I'm looking for this function for Windows, Linux too if you have it.
It is mentioned in http://gafferongames.com/game-physics/fix-your-timestep/.
I've looked on the web.
I know it's not a standard function but if anybody has an implementation that they want to share, that would be great.
Failing that, I need something as fine grained as possible to do synchronization in a client server game.
It's not a real function, it's just a self-descriptive placeholder name used in that blog post's example code.
For Windows, you'll want to use QueryPerformanceCounter along with QueryPerformanceFrequency. For Unix-based OSes, you'll want to use gettimeofday(3).