wxWidget(gui) and Thread

function_a and function_b


main gui thread:
Call function_a in a child thread, post a message(thread-safe by wxWidget self) to the main gui thread after function_a is finished. Then the main gui thread call function_b.

Because function_b will use the data changed by function_a, I care more about the thread-safety.

My colleague said: 'post a message' ensure that function_b will see all data modified by function_a.

Is it right?
Last edited on
If the data is not longer used in one thread it can be safely used in another. So yes, if the data is not touched in the child thread after the call to the post message you can use it in function_b.
Thanks!
Topic archived. No new replies allowed.