[M3devel] manual initialization order?

Tony Hosking hosking at cs.purdue.edu
Tue Apr 28 23:41:19 CEST 2009


Indeed it is fragile, but necessary to bootstrap the system.

On 29 Apr 2009, at 00:15, Jay wrote:

>
> 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