Hey… I have an external, which is, for the most part, thread safe. My one remaining concern is this:
In overdrive, will my object ever have its delete (free) method called by one thread while other threads are still inside performing calculations and such? If so, is there any commonly-accepted way in an external to tell said still-busy thread to abort ASAP?
Hi Alex – I didn’t see an answer to your Q, so sorry if this is stuff
you already have figured out.
I believe the free method will only ever get called from the main
thread. I’m sure someone will correct me if I’m wrong. That said, it
is unlikely but possible for the object to be processing something in
the scheduler or perform threads and be deleted at the same time.
On 15-Mar-2006, at 6:40, Ben Nevile wrote:
> I believe the free method will only ever get called from the main
Unless I’m very much mistaken, an object’s instantiation method is
guaranteed to be called from the main thread *and can make
assumptions based on that premise*. (In the old days this included
things like NewPointer() and NewHandle() being safe).
Since a free method is almost necessarily predicated on the same
assumptions that the instantiation method is (e.g., freeing up memory
allocated with NewPointer() or NewHandle() or whatever), it would be
highly uncool to call xxx_free() from anywhere else.