Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-07 Thread Ken Thomases
On May 6, 2013, at 5:26 PM, Motti Shneor wrote: > Hello Ken, and so-many-thanks for the information. You're welcome. More below… > On 4 במאי 2013, at 07:24, Ken Thomases wrote: > >> Honestly, I doubt that -dealloc is reentered. I suspect you've misdiagnosed >> what is happening or, perhaps,

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-06 Thread Motti Shneor
Hello Ken, and so-many-thanks for the information. On 4 במאי 2013, at 07:24, Ken Thomases wrote: > On May 2, 2013, at 11:53 AM, Jens Alfke wrote: > >> On May 1, 2013, at 5:10 AM, Motti Shneor wrote: >> >>> Currently, MyB retains itself within its thread, and releases itself just >>> before t

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-03 Thread Ken Thomases
On May 2, 2013, at 11:53 AM, Jens Alfke wrote: > On May 1, 2013, at 5:10 AM, Motti Shneor wrote: > >> Currently, MyB retains itself within its thread, and releases itself just >> before the thread exits. I know it is bad practice (self retaining objects), >> but I did not yet think of a better

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hi and thanks Kyle, Fritz, Jens and everyone else On 2 במאי 2013, at 20:31, Kyle Sluder wrote: > On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote: >> Hello. >> >> I have two NSObject subclasses - say MyA and MyB. >> >> - Each MyA instance. creates and owns a MyB instance. >> - MyB

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Kyle Sluder
On Wed, May 1, 2013, at 05:10 AM, Motti Shneor wrote: > Hello. > > I have two NSObject subclasses - say MyA and MyB. > > - Each MyA instance. creates and owns a MyB instance. > - MyB instances create an NSThread, and live their asynchronous life, > communicating with a remote internet server,

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Jens Alfke
On May 1, 2013, at 5:10 AM, Motti Shneor wrote: > Currently, MyB retains itself within its thread, and releases itself just > before the thread exits. I know it is bad practice (self retaining objects), > but I did not yet think of a better way. > > This way, when the owner releases its MyB

Re: Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Fritz Anderson
On 1 May 2013, at 7:10 AM, Motti Shneor wrote: > - Each MyA instance. creates and owns a MyB instance. > - MyB instances create an NSThread, and live their asynchronous life, > communicating with a remote internet server, and sometimes with their owner > (the MyA object) who lives in the main

Need advice: Object ownership and threading issue, causing a rare crash.

2013-05-02 Thread Motti Shneor
Hello. I have two NSObject subclasses - say MyA and MyB. - Each MyA instance. creates and owns a MyB instance. - MyB instances create an NSThread, and live their asynchronous life, communicating with a remote internet server, and sometimes with their owner (the MyA object) who lives in the

Re: Threading issue

2012-08-01 Thread Jens Alfke
On Jul 20, 2012, at 12:04 PM, Bruce Sherwood wrote: > However, the Cocoa GUI environment and interact loop are required to > be in the primary thread, so the challenge is to have the visual > module set up the Cocoa environment, with the user's program running > in a secondary thread. This soun

Threading issue

2012-08-01 Thread Bruce Sherwood
I want to make a version of VPython (vpython.org) that is based on Cocoa (the Mac version is currently based on Carbon). The VPython API permits the following short user program, which displays a 3D cube moving to the right, and you can rotate and zoom the camera with the mouse: from visual impor