Re: [Vala] async method and delegate
- From: Luca Bruno <lethalman88 gmail com>
- To: Jim Nelson <jim yorba org>
- Cc: vala-list gnome org
- Subject: Re: [Vala] async method and delegate
- Date: Tue, 21 Jun 2011 21:16:23 +0200
On Tue, Jun 21, 2011 at 11:09:47AM -0700, Jim Nelson wrote:
On Mon, Jun 20, 2011 at 6:27 PM, Nor Jaidi Tuah <norjaidi tuah ubd edu bn>wrote:
On Mon, 2011-06-20 at 17:37 -0700, Jim Nelson wrote:
With async, the delegate *is* copied, you just don't see it in the
Vala code. With an async method, when the thread of execution yields,
the state of the function at that point is stored (copied or ref'd) in
a context structure. When the thread of execution resumes later, the
state is pulled back out and the function resumes.
Has that any bearing on the bug I mentioned in
my earlier email?
If you mean the warning about copying delegates being discouraged, then yes
it has bearing -- the delegate is being copied inside the async function.
That's my point, the warning is accurate, it's because async methods have
certain side-effects that are not apparent in the code on the screen. For
another example of this, see
https://bugzilla.gnome.org/show_bug.cgi?id=639054
The problem regarding the closure I haven't looked into.
That bug is more complex. Instead, it can be partially solved for unowned
delegates if you report a bug.
--
http://www.debian.org - The Universal Operating System
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]