pthreads - What is the best technique to create a thread in C++ while passing the class and an index? -
I am creating data-parallel programs using pthreads and C ++, I came to know that a static indicator + How to supply pthread_create
with the function pointer with the + function (and it provides a this
argument).
However, I also need to supply the thread with an index, so it knows what data it is working on. I could have used the malloc
for each thread with a straight (both in the C ++ class and index), but it seems that this will add some bookkeeping code, and if the structure is not ' Is T-free a Better Way to Do It?
You can use this provides a type-safe approach for you that is in your responsibility .
Yes, according to your question, there are similar types of bookkeeping, but to ensure that it does not leak, uses C ++ system.
Comments
Post a Comment