Type: Posts; User: Codeplug
Search took 0.11 seconds.
December 10th, 2014, 01:31 PM
>> And for C++11 the manual very clearly states volatile is for hardware access only (interrupts on the same thread) and not to be used for multithreading, you should use the <atomic> stuff for...
December 9th, 2014, 01:37 PM
>> No they don't. or rather, the sync primitives don't do this in and by themselves.
"Pull over, pull over - semantics police!"
So they don't solve 1 and 2 in and by themselves, but by them being...
December 8th, 2014, 08:40 PM
Critical sections, and all Win32 synchronization primitives, solve 1 and 2.
November 26th, 2014, 12:25 PM
Some things that come to mind:
Have a common base object with a virtual destructor that does nothing - then remove all other destructors. This should route all destrutor calls to the virtual base...
November 25th, 2014, 01:38 PM
It seems to me that 2 "strands" would be defined as 2 independent tasks that have no shared resources between them (or if they do, synchronization is involved).
If so, then replacing threads with...
November 23rd, 2014, 12:06 PM
>> For c++11 rather than use a mutex, I use atomic compare_exchange for multi threaded singletons
In my own Windows implementation, I use an interlocked add for the fast-path and a critical-section...
November 21st, 2014, 02:59 PM
>> Simultaneous read/write access to global resources from multiple threads needs a more careful planned approach than just willy nilly making stuf atomic.
>> you should prefer atomic...
November 10th, 2014, 04:17 PM
I would detect the line ending style when opening an exist files and preserve it. When saving a new file, you could have an option settings for the default ending style to use or just ask the user...
November 7th, 2014, 01:44 PM
I've implemented a couple of dynamic hash tables for different applications in the past. They needed O(x) guarantees and so they were implemented by hand and there was no rehashing. In other words,...
November 3rd, 2014, 12:57 PM
Have the user provide a handle for where the DLL should send its output. Then the user can provide a console handle, file, pipe, etc..
October 24th, 2014, 02:26 PM
>> Definitely no.
Definitely yes. More reading: http://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/#using-a-c11-static-initializer
The rest of that post is good reading too.
October 23rd, 2014, 09:49 PM
With a compliant C++ implementation, this really all you need:
static simpleSingleton* getInstance()
static simpleSingleton s_instance;
If your compiler...
October 15th, 2014, 11:00 AM
Correct again. I've been relying on RAII objects just "doing the right thing" for too long :)
October 14th, 2014, 05:11 PM
>> ... and MSVCR120.dll in the Cinema 4D folder
That should be handled by the appropriate VS runtime redistributable. (eg. http://www.microsoft.com/en-us/download/details.aspx?id=30679)
October 14th, 2014, 04:53 PM
Didn't see your last post...
Well, you wouldn't want to link statically to GPL source (without purchasing a license to do so). And some may even require a license to be used in a commercial...
October 14th, 2014, 04:45 PM
What protocols are used when accessing your server? Is it plain HTTP? Through TCPIP or TLS (SSL)?
What libraries did you use to achieve this access on MacOS?
October 14th, 2014, 04:18 PM
>> ... documentation on Get says it takes care of that ...
You are correct. My mistake.
>> One nice thing about using _com_ptr_t, _variant_t, and _bstr_t ...
One unfortunate thing is that there...
October 14th, 2014, 01:08 PM
A call to VariantInit() is missing (though the variant's initial values are not used in this case).
The VariantClear() call could be moved up 2 if blocks.
The call to...
October 13th, 2014, 07:25 PM
October 13th, 2014, 07:22 PM
One of your problems is the you are using an uninitialized variant and safearray. You'll want to use ATL's wrappers for these objects - CComVariant etc.
October 11th, 2014, 01:29 PM
>> Think WinAPI if the task is about WinAPI!
Are you saying that we should just be calling ::SetTimer in order to accomplish the task? Or that we should re-do everything in MFC in order to use its...
October 10th, 2014, 12:48 PM
>> Make Simple Tasks Simple!
I couldn't agree more.
The "task" in this case - and the reason for my participation in this thread - is to have ::SetTimer() callbacks into a C++ object instance...
October 9th, 2014, 10:58 AM
I'll choose a solid C++ interface over a C interface any day. I won't let a few lines of code stop me from creating one either.
If you have object instances that need their methods called on a...
October 8th, 2014, 01:52 PM
#include "WinTimerDispatch.h" // post #19
October 6th, 2014, 08:33 AM
This is what I use:
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.