¡@

Home 

c++ Programming Glossary: worker

C state-machine design

http://stackoverflow.com/questions/1647631/c-state-machine-design

one small ish state machine at the heart of one of my worker thread. I was wondering if you gurus on SO would share your..

How can I tell reliably if a boost thread has exited its run method?

http://stackoverflow.com/questions/1667420/how-can-i-tell-reliably-if-a-boost-thread-has-exited-its-run-method

this however it does not seem to be the case. In a worker class I was trying to indicate that it was still processing..

How can I propagate exceptions between threads?

http://stackoverflow.com/questions/233127/how-can-i-propagate-exceptions-between-threads

thread . Within the body of the function we spawn multiple worker threads to do CPU intensive work wait for all threads to finish.. dealing with exceptions. We don't want exceptions on the worker threads to crash the application. We want the caller to the.. them on the main thread. We must catch exceptions on the worker threads and propagate them across to the main thread to have..

ReleaseSemaphore does not release the semaphore

http://stackoverflow.com/questions/2375132/releasesemaphore-does-not-release-the-semaphore

happens in the following case the main thread resumes the worker threads for int i 0 i numCPU i if WaitForSingleObject semaphore.. 1 WAIT_TIMEOUT printf Timed out n ResumeThread ids i the worker threads do their work and release the semaphore for int i 1.. semaphore 1 NULL FALSE the main thread waits for all worker threads and resets the semaphore for int i 0 i numCPU i WaitForSingleObject..

Why override operator()?

http://stackoverflow.com/questions/317450/why-override-operator

in C For callbacks etc. I have seen this in code of a co worker who happens to be a big Boost fan . Of all the Boost goodness..

Is 'volatile' needed in this multi-threaded C++ code?

http://stackoverflow.com/questions/3612505/is-volatile-needed-in-this-multi-threaded-c-code

which is set to true when the GUI thread signals the worker thread to abort. Here is the code which implements this behaviour.. protected Dialog This points to the variable which the worker thread reads to check if it should abort or not. bool volatile.. switch progressMode_ if confirmAbort This causes the worker thread to be aborted threadParameterAbort_ true break ..

Compare std::wstring and std::string

http://stackoverflow.com/questions/7141260/compare-stdwstring-and-stdstring

std wstring get_wstring const std wstring s return s Real worker std wstring get_wstring const std string s const char cs s.c_str.. string get_locale_string const std string s return s Real worker std string get_locale_string const std wstring s const wchar_t..

Throwing exceptions from constructors

http://stackoverflow.com/questions/810839/throwing-exceptions-from-constructors

exceptions from constructors Im having a debate with a co worker about throwing exceptions from constructors and thought I would..

while (1) Vs. for (;;) Is there a speed difference?

http://stackoverflow.com/questions/885908/while-1-vs-for-is-there-a-speed-difference

Vs. for Is there a speed difference Long version... A co worker asserted today after seeing my use of while 1 in a Perl script.. between. I could find no appreciable difference. My co worker said that a professor had told him that the while 1 was doing.. things from this discussion. Update The aforementioned co worker weighed in with a response below. Quoted here in case it gets..

Getting return value from a boost::threaded member function?

http://stackoverflow.com/questions/1713171/getting-return-value-from-a-boostthreaded-member-function

function I have a worker class like the one below class Worker public int Do int ret 100 do stuff return ret It's intended.. to be executed with boost thread and boost bind like Worker worker boost function int th_func boost bind Worker Do worker.. like Worker worker boost function int th_func boost bind Worker Do worker boost thread th th_func th.join My question is how..

Thread Wait For Parent

http://stackoverflow.com/questions/5799924/thread-wait-for-parent

while here. This is because of the situation. Two workers Worker A processing job A. Worker B suspended on condition variable... of the situation. Two workers Worker A processing job A. Worker B suspended on condition variable. Parent adds a new job and.. signal. This wakes up thread B. But it is possible for Worker A to finish its work and lock the mutex before the Worker B..

What exactly is join() in Boost? (C++)

http://stackoverflow.com/questions/6241738/what-exactly-is-join-in-boost-c

running. #include iostream #include boost thread.hpp class Worker public Worker the thread is not a thread until we call start.. iostream #include boost thread.hpp class Worker public Worker the thread is not a thread until we call start void start int.. we call start void start int N m_Thread boost thread Worker processQueue this N void join m_Thread.join void processQueue..