Hi, The progress functions in the NDK are thread safe. As you say, they transfer the UI updates to the main thread. You can't do any other UI work in a background thread though.
Jerry On 29 Nov 2011, at 20:35, Nathan Rusch wrote: > Right, that all makes sense. However, curiosity prevails... > > The fact that there are no mentions anywhere in any of the NDK docs about > progressFraction being unsafe to use in engine calls has me thinking it may > be possible that the Op interface is handling message and progress handoffs > to Nuke transparently to avoid these sorts of issues. I guess what I’m > getting at is that maybe it’s not the Op::engine call itself that updates the > interface, but rather it simply provides information that the GUI thread can > choose to make use of. > > Also, many of the sample Writer-derived classes use progressFraction fairly > liberally in their execute() calls, and while I know these are probably > single-threaded, I would venture to guess they aren’t running in the GUI > thread either. > > -Nathan > > > From: Steven Booth > Sent: Tuesday, November 29, 2011 11:35 AM > To: Nuke plug-in development discussion > Subject: RE: [Nuke-dev] Re: progressFraction bar not showing > > It is never acceptable to update a UI from any thread other than the one that > created it, which is almost always the ‘main’ or ‘primary’ thread. Nuke > spawns separate, dependent threads for all engine calls, and as such, > updating any UI element from inside an engine call is an undefined operation. > The _validate, _open, _close, _invalidate, and knobs function calls are all > executed in the main thread, and are UI-safe. > > This, in fact, is a major problem for many Nuke developers that want to > manipulate the display as a part of processing. The only way to do it > properly is to save state changes in a module-global variable inside your > engine call, and then use the new values to update the UI in either _close or > _invalidate. > > It’s not a question of engine being thread-safe – it is – rather, it’s a > question of the UI elements being thread-safe, which is not guaranteed. > > Steve > > > From: [email protected] > [mailto:[email protected]] On Behalf Of Nathan Rusch > Sent: Tuesday, November 29, 2011 10:51 AM > To: [email protected] > Subject: Re: [Nuke-dev] Re: progressFraction bar not showing > > Can you elaborate on this at all? I’m calling progressFraction in a plugin’s > engine method with zero crashes, but while calling it, my engine is locked to > a single thread... do you mean these functions aren’t thread-safe? Or are you > talking about other UI update calls? > > -Nathan > > > From: Steve3D > Sent: Tuesday, November 29, 2011 7:41 AM > To: [email protected] > Subject: [Nuke-dev] Re: progressFraction bar not showing > > I hope you're not trying to update the UI from inside an 'engine' thread, > because that's not allowed, and if it works, it will work intermittently and > cause crashes. > _______________________________________________ > Nuke-dev mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev > (CONFIDENTIALITY NOTICE: The information contained in this email may be > confidential and/or privileged. This email is intended to be reviewed by only > the individual or organization named above. If you are not the intended > recipient, or an authorized representative of the intended recipient, you are > hereby notified that any review, dissemination or copying of this email, or > the information contained herein is strictly prohibited. If you have received > this communication in error, please notify the sender by return email and > delete this email from your system. Thank You.) > > > _______________________________________________ > > Nuke-dev mailing list > > [email protected], http://forums.thefoundry.co.uk/ > > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev > > _______________________________________________ > Nuke-dev mailing list > [email protected], http://forums.thefoundry.co.uk/ > http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev Jerry Huxtable, Senior Product Designer The Foundry Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906 Web: www.thefoundry.co.uk Email: [email protected] The Foundry Visionmongers Ltd. Registered in England and Wales No: 4642027
_______________________________________________ Nuke-dev mailing list [email protected], http://forums.thefoundry.co.uk/ http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
