joydeeps / cppthreadpool Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/cppthreadpool
Automatically exported from code.google.com/p/cppthreadpool
What steps will reproduce the problem?
1. Attempted compilation of example on Fedora 8 using gcc (GCC) 4.3.2 20081007
2.
3.
What is the expected output? What do you see instead?
threadpool.cpp: In constructor ‘ThreadPool::ThreadPool(int)’:
threadpool.cpp:33: error: expected primary-expression before ‘{’ token
threadpool.cpp:33: error: expected `;' before ‘{’ token
threadpool.cpp:125: error: expected `}' at end of input
make: *** [threadpool.o] Error 1
What version of the product are you using? On what operating system?
Fedora 8 i386
Please provide any additional information below.
I'm no expert, but I think PTHREAD_MUTEX_INITIALIZER requires a static mutex.
Declaring as private in threadpool.h:
static pthread_mutex_t mutexSync;
static pthread_mutex_t mutexWorkCompletion;
and then defining in threadpool.cpp outside the constructor:
pthread_mutex_t ThreadPool::mutexSync = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t ThreadPool::mutexWorkCompletion = PTHREAD_MUTEX_INITIALIZER;
Make the example compile for me....
Other than that, the threadpool is awesome!
Cheers,
Mike
Original issue reported on code.google.com by [email protected]
on 1 Mar 2009 at 11:54
What steps will reproduce the problem?
1. compile project (gcc version 4.3.2 (Debian 4.3.2-1))
2. run main example
What is the expected output? What do you see instead?
All Done!! Wow! That was a lot of work!
22 seconds elapsed
*** glibc detected *** ./main: corrupted double-linked list: 0x0899b0b0 ***
======= Backtrace: =========
/lib/i686/cmov/libc.so.6[0xb7d756b4]
/lib/i686/cmov/libc.so.6[0xb7d77603]
/lib/i686/cmov/libc.so.6(cfree+0x96)[0xb7d778b6]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb7f67281]
./test[0x8049045]
./test(__gxx_personality_v0+0x276)[0x8048cba]
/lib/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7d1d455]
./test(__gxx_personality_v0+0x5d)[0x8048aa1]
======= Memory map: ========
What version of the product are you using? On what operating system?
v1.0
Debian 4.0 Lenny
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 22 Oct 2008 at 10:20
When first time, i.e., k = 0, called, there is absolutely no problem. But when
k = 1, the application terminates.Irrespective of the logic, the subsequent
call to threadpool creates the issue of abnormal termination.
...
.....
int main(int argc, char **argv)
{
for(int k=0;k<2;k++) {
ThreadPool* myPool = new ThreadPool(25);
myPool->initializeThreads();
for(unsigned int i=0;i<ITERATIONS;i++){
SampleWorkerThread* myThread = new SampleWorkerThread(i);
myPool->assignWork(myThread);
}
myPool->destroyPool(2);
delete myPool;
}
return 0;
}
Original issue reported on code.google.com by [email protected]
on 20 Feb 2013 at 2:46
dfsfsf
Original issue reported on code.google.com by [email protected]
on 19 Nov 2014 at 7:57
Attachments:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.