You should read the FAQ at parashift.com about that.
There are several problems with the code. First one, it's not complete.
Second one, it seems to use several global variables. Third one is that
it's not a _minimal_ example that demonstrates your problem.
First thing you should do is think about who owns what data and, if it is
shared and concurrent accesses take place how those are synchronized. For
your info, pthread_create takes a function pointer and a data pointer. The
function pointer is where the new thread enters existence, the data
pointer is to provide the new thread with some context, i.e. so you don't
have to store data in global variables.
Other than that, you should not have to use any cast except the one
static_cast<> inside the thread function to convert the typeless pointer
back to what it initially was.
Lastly, you don't check for a single error in your code. How do you expect
it to behave properly if you don't even do that? Just a hint: in C++, you
can separate error-handling code from the 'real' code by using exceptions.
BTW, how do you determine that execute() is not called? Remember that
std::cout is buffered and that you don't flush that buffer anywhere,
neither implicit (via std::endl) nor explicitly.
see C++-FAQ Lite: http://www.yqcomputer.com/
++-faq-lite/ first !