[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: does method invocation involve a lock?
From: |
Andreas Fink |
Subject: |
Re: does method invocation involve a lock? |
Date: |
Fri, 21 Sep 2018 16:57:05 +0200 |
If I remember correctly, methods are not locked. They can run in parallel
multiple times in multiple threads.
The exception are properties with the atomic attribute where the compiler
synthesizes the getter/setter and thus makes sure that a getter and setter dont
conflict with each other
@property(atomic)
does this (which is default if I'm not mistaken). But that doesn't apply to
methods.
> On 21 Sep 2018, at 16:49, Tom Sheffler <tom.sheffler@gmail.com> 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.
>
> Thanks for any insights.
> -Tom
>
>
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep