## Recommended Posts

Hi all: I have a function
void FuncA(obj o, arg1 a1, arg2 a2);

Because I have to run the FuncA for many times for different objects, I am thinking it's probably better to run multithread so that each thread contains each object. I have just read a small tutorial in http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html However, I am still not sure how to start a thread if the arguments of FuncA is multiple. Also, the pthread_t looks quite out-of-date and it's in C although it works in C++. Could anyone give me any idea how to do this please? Thanks

##### Share on other sites
I've recently written a library which does exactly that. It requires boost to run, but other than that it's just a header you include.

Flow

Just make sure that threads don't alter the same objects without locks, and all will be fine.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628316
• Total Posts
2982033

• 9
• 9
• 13
• 11
• 14