kfeng Messages: 18 Registered: July 2007 Location: Tokyo, Japan
Promising Member
OK, suppose I have a C struct with a bunch of pointers to the heap:
struct
{
int *intP;
double *doubleP;
char **strP;
...
}
It's filled out by the child process and I pass a pointer to an instance to PostCallback(). Will PostCallback() be smart enough to lock all the pointed-to members? If not, is there a way to make the child thread block and wait until the parent is done reading?
The problem is **strP - I need this to run fast so I don't want to be looping through the members locking each one by hand - may be simpler to just get the child to wait for the parent to finish. Is there a way I can do this to a child thread?