This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Objective-C patch fixing libobjc/9969


Nicola Pero wrote:

Ok to apply (tested, no regressions, and gnustep-base seems to be still
working fine with this change) ?

Wed May 14 11:25:41 2003 Nicola Pero <n.pero@mi.flashnet.it>

       libobjc/9969
       * sendmsg.c (get_imp): Fixed threading problem which might cause
       in extremely rare cases to return the forward method
       implementation instead of the actual method when the dispatch
       table was being installed by a concurrent thread.  Fixed threading
       problem which might cause in extremely rare cases the dispatch
       table to be installed twice - with a small memory leak - in
       similar situations.  This change adds some overhead to messaging
       whenever a forward implementation is returned.
       (__objc_responds_to): Similar fixes.
       (objc_msg_lookup): Similar fixes.

This just seems like it lowers the odds of messing up without
really solving the problem.  The rule of thumb is that a
concurrent thread can kick in between any pair of instructions,
and the "if (class->dtable == __objc_uninstalled_dtable)" will
be several instructions usually. (That's why atomic test-and-set
instructions are so important.)

Shouldn't the runtime mutex be locking out dispatch table installs
by other threads?

Stan




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]