[M3devel] manual initialization order?

Jay jay.krell at cornell.edu
Tue Apr 28 16:15:50 CEST 2009


Um, if initializers are so acceptable (I'm skeptical, but everyone here disagrees with me..) and circularities are not allowed (that helps I guess..but is it really true? the garbage collector uses threads, the threading library allocates traced references..I sense circularity...)...why does RTLinker manually pick an initialization order? This is fragile.
 
 
    (* initialize the rest of the modules we'll be calling *)
    AddUnit (RTLinkerX.RTLinker_I3);  (* myself! *)
    AddUnit (RTLinkerX.RT0_I3);
    AddUnit (RTLinkerX.RTSignal_I3);
    AddUnit (RTLinkerX.RTParams_I3);
    AddUnit (RTLinkerX.RTDebug_I3);
    AddUnit (RTLinkerX.RTError_I3);
    AddUnit (RTLinkerX.RTHeapRep_I3);
    AddUnit (RTLinkerX.ThreadF_I3);
    AddUnit (RTLinkerX.RTHeapInfo_I3);
    AddUnit (RTLinkerX.RTIO_I3);
    AddUnit (RTLinkerX.RTCollectorSRC_I3);
    AddUnit (RTLinkerX.Word_I3);
 
 
 
    (* finally, initialize the runtime. *)
    RTSignal.InstallHandlers ();
    RTParams.Init ();
    RTHeapRep.Init ();
    ThreadF.Init ();
    RTDebug.Init ();
    RTHeapInfo.Init ();
    IF RTParams.IsPresent("tracelinker") THEN
      traceInit := TRUE;
    END;
 
 
    AddUnit (RTLinkerX.RTDebug_M3);
    AddUnit (RTLinkerX.RTError_M3);
    AddUnit (RTLinkerX.RTType_M3);
    AddUnit (RTLinkerX.RTPacking_M3);
    AddUnit (RTLinkerX.RTTipe_M3);
    AddUnit (RTLinkerX.RTException_M3);


More information about the M3devel mailing list