if have shared object between 2 threads (by passing in void pointer object) happens if both try call (different) methods @ same time? i'm not worried member variables themselves, there's mutex in place other reasons luckily covers already. main function calling disjoint methods there's no possibility of overlap way, wasn't sure behavior if main calls thing.a() while thread calls thing.b() @ same time (or if overlap matter).
nothing special happen, each thread has own stack, , each call (even if same function) have own call-frame , own set of arguments , local variables.
Comments
Post a Comment