Thread stack pointers

Delvin Defoe delvin.defoe@gmail.com
Wed Mar 21 21:27:00 GMT 2007


Does this mean if I define sigaction act, set the handler as follows,
  // for stack processing
  act.sa_handler = _otf_process_stack;
  sigemptyset(&act.sa_mask);
  act.sa_flags = 0;

signal the thread in the following manner



On 3/21/07, David Daney <ddaney@avtrex.com> wrote:
> Delvin Defoe wrote:
> > Hi:
> >
> > I am implementing a multi-thread, multiprocessor garbage collection
> > system for Java in gcc.  In the runtime system I need to determine the
> > stack base and stack top pointers for each mutator in order to scan
> > the stack for each mutator for pointers to live heap objects.   Any
> > idea how I can determine or compute these pointers?
> >
> Generic answer:
> How about doing the same thing boehm-gc does?
>
> For linux, you would have each thread is register with the GC when it is
> started.  In this registration function you find the address of
> something on the stack of that thread, then look in /proc/self/maps to
> see what memory range contains that address.  That range will be your
> stack bounds.
>
> To find the stack top, send a signal to a thread, and then the stack top
> will be slightly above the address of an automatic variable of the
> signal handler function.
>
> David Daney
>


-- 
***********************************************************
Delvin Defoe
Doctoral Candidate
Department of Computer Science
Washington University in Saint Louis
314.935.4502
http://www.cs.wustl.edu/~dcd2/
***********************************************************



More information about the Java mailing list