Re: Cheating a synchronous call on the main thread
Re: Cheating a synchronous call on the main thread
- Subject: Re: Cheating a synchronous call on the main thread
- From: Jens Alfke <email@hidden>
- Date: Mon, 29 Jun 2015 14:25:12 -0700
> On Jun 29, 2015, at 1:50 PM, Gavin Eadie <email@hidden> wrote:
>
> This is all true for a “really synchronous” call, but my suggestion is that an “apparently synchronous” call only appears to wait; using a semaphore can stop the return, while things keep working on other threads.
I don’t think that’s a distinction worth making. The effect is exactly the same: the method actually does wait. It doesn’t return until the work is done, so the thread it’s called on is blocked. That’s a synchronous call. The only difference is on which thread the work is being done, but that’s not really important.
(For example, by your definition every system call in the OS is only ‘apparently’ synchronous, because when you make a system call your thread is paused while a kernel thread wakes up and does the work, after which your thread resumes. But no one but a kernel developer thinks of functions like read( ) as asynchronous.)
—Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden