This is the mail archive of the gcc@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]

Re: How EGCS with multi-threaded compliance?


Nathan Myers wrote:
> 
> David Lucas <dlucas@checkfree.com>
> > Just an observastion, but some compilers do not even guarentee that
> > init_lock will be initialized before the use of f_initialize_a, thus a
> > possible uninitialized Mutex object.
> 
> On any Real System, the mutex object is correctly initialized
> by the runtime loader before any static constructors are run.
> That is, the zero value is a valid, unlocked mutex.

But if the function using the static object (mutex) is being called from
static space, and not after main starts (which at that point all statics
are guarenteed initialized), then a chicken and egg condition could
occur.  =-)

Later,
Dave

-- 
-----------------------------------------------------------------
David Lucas                    |  mailto:dlucas@checkfree.com
Staff Software Engineer        |                                  
Systems Software Development   |  My opinions are IMHO.
OFX Server Devl 08-126         |                                  
                               |
CheckFree Corporation          |  Work#  614.825.3511            
8275 High Street               |  Fax#   614.825.3104            
Columbus, OH 43235             |  http://www.checkfree.com
-----------------------------------------------------------------


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