> On 21 Sep 2018, at 15:49, Tom Sheffler <[email protected]> wrote: > > This question is for my own research: I’m curious about whether invoking [obj > method] can block. If obj is allocated, and method is simple, does method > invocation involve a lock. > > I think the answer is YES. But I looked at the source code for objc_msgSend > and didn’t see anything that looked like it acquired a lock.
The answer is usually NO, but the first time you send any method to a class the +initialize method of that class is implicitly called, and that operation is implicitly lock protected. If you are worried about that, the simple solution is to make sure that classes you are concerned about are initialised at the start of your program (eg by calling the +class method) , so that code executing later can be confident that there won't be unexpected blocking. _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
