[M3devel] Calling RTHeapStats.ReportReachable(); with Pthread cvs head
Daniel Alejandro Benavides D.
dabenavidesd at yahoo.es
Thu Nov 22 20:56:04 CET 2007
Hi:
Yes, it is working; shownew and also the test program.
Thanks.
--- Tony Hosking <hosking at cs.purdue.edu> wrote:
> Have you tried this lately? It seems to work fine
> for me on Fedora
> Core.
>
> On Oct 30, 2007, at 12:48 PM, Daniel Alejandro
> Benavides D. wrote:
>
> > Hi:
> > LINUXLIBC6 32 bits, ubuntu dapper
> >
> > >Hmm. showheap works fine for me on my I386_DARWIN
> box. What
> > >platform are you on?
> >
> > On Oct 30, 2007, at 2:24 AM, Daniel Alejandro
> Benavides D. wrote:
> >
> > > Hi:
> > > About this last changes, the runtime can not
> properly
> > > feed shownew, with a @M3shownew=shownew.
> > > The program 'a' is just not started as it seems
> here,
> > > altough the window (shownew) does appear, start
> > > doesn't respond, and it stays there until
> aborted.
> > >
> > > Thanks
> > >
> > > --- "Daniel Alejandro Benavides D."
> > > escribió:
> > >
> > >> Hi:
> > >> Yes it's working very well. I'm sorry for the
> delay.
> > >> Thanks.
> > >> --- Tony Hosking escribió:
> > >>
> > >>> Please try the latest CVS head.
> > >>>
> > >>> On Oct 21, 2007, at 6:03 PM, Daniel Alejandro
> > >>> Benavides D. wrote:
> > >>>
> > >>>> Hi:
> > >>>> Im trying to execute the following program
> with
> > >>> the Pthread cvs
> > >>>> head implementation and I got this when
> > >> executing
> > >>> the program:
> > >>>>
> > >>>> danielb at danielb-desktop:~/as207/code/m3gdb$
> > >>> LINUXLIBC6/Main
> > >>>> Entre dos enteros6 7
> > >>>> Estadisticas del Heap
> > >>>> HEAP: 0xb73d2000 .. 0xb7412000 => 0.2 Mbytes
> > >>>>
> > >>>>
> > >>>> ***
> > >>>> *** runtime error:
> > >>>> *** <*ASSERT*> failed.
> > >>>> *** file
> > >>> "../src/thread/PTHREAD/ThreadPThread.m3", line
> 992
> > >>>> ***
> > >>>>
> > >>>> Aborted
> > >>>> danielb at danielb-desktop:~/as207/code/m3gdb$
> > >>>>
> > >>>> The assert violated in
> > >>> m3core/thread/PTHREAD/ThreadPthread.m3 is
> this:
> > >>>> PROCEDURE ProcessOther (act: Activation; p:
> > >>> PROCEDURE (start,
> > >>>> stop: ADDRESS)) =
> > >>>> (* LL=activeMu *)
> > >>>> VAR
> > >>>> sp: ADDRESS;
> > >>>> state: RTMachine.ThreadState;
> > >>>> BEGIN
> > >>>> <*ASSERT act.state = ActState.Stopped*>
> > >>>>
> > >>>>
> > >>>> The source code of the little program is
> this:
> > >>>>
> > >>>> MODULE Main;
> > >>>>
> > >>>> IMPORT SIO;
> > >>>> IMPORT RTHeapStats;
> > >>>> IMPORT RTutils;
> > >>>> IMPORT RTHeapDebug;
> > >>>> VAR
> > >>>> varA, varB, varC: INTEGER;
> > >>>>
> > >>>>
> > >>>> PROCEDURE multiplicar(a,b: INTEGER): INTEGER=
> > >>>> VAR
> > >>>> varC: INTEGER;
> > >>>> BEGIN
> > >>>> varC:=a*b;
> > >>>> RETURN varC;
> > >>>> END multiplicar;
> > >>>>
> > >>>>
> > >>>> BEGIN
> > >>>>
> > >>>> SIO.PutText("Entre dos enteros");
> > >>>> varA:=SIO.GetInt();
> > >>>> varB:=SIO.GetInt();
> > >>>> varC:=multiplicar(varA,varB);
> > >>>> SIO.PutText("Estadisticas del Heap");
> > >>>> RTHeapDebug.CheckHeap();
> > >>>> RTHeapStats.ReportReachable();
> > >>>> (* RTutils.Heap
> > >>>>
> > >>>
> > >>
> > >
>
(FALSE,RTutils.HeapPresentation.ByTypecode,TRUE,LAST(CARDINAL));*)
> > >>>> SIO.PutInt(varC);
> > >>>>
> > >>>> END Main.
> > >>>>
> > >>>> According to the draft book of Michael
> Dagenais
> > >>> Building
> > >>>> Distributed OO Applications: Modula-3 Objects
> > >> at
> > >>> Work,
> > >>>> RTHeapStats.ReportReachable()
> > >>>> " ... is called to determine the number
> > >>>> of active, reachable, objects (i.e. those
> which
> > >>> would not be
> > >>>> garbage collected). Of the 1980 objects on
> the
> > >>> heap, only slightly
> > >>>> more than half are still alive."
> > >>>>
> > >>>> According to the interface documentation:
> > >>>> "reports the number of reachable objects and
> > >>> bytes from each
> > >>>> compilation unit, thread stack, and the
> > >> individual
> > >>> roots that reach
> > >>>> the most bytes. The report is written to
> stderr.
> > >>> The Modula-3
> > >>>> process is frozen during the scanning and
> > >>> reporting."
> > >>>>
> > >>>> Obviously with the previous version of
> pthread
> > >> the
> > >>> things were
> > >>>> working fine, also with user level
> > >> implementation
> > >>>>
> > >>>> Thanks,
> > >>>>
> > >>>> Daniel Benavides
> >
> >
> > ¡Descubre una nueva forma de obtener respuestas a
> tus preguntas!
> > Entra en Yahoo! Respuestas.
>
>
______________________________________________
¿Chef por primera vez?
Sé un mejor Cocinillas.
http://es.answers.yahoo.com/info/welcome
More information about the M3devel
mailing list