Branch: refs/heads/master
Home:   http://github.com/penberg/jato

Commit: 6f76d8586618a09d7c8173b5aaff38b011436317
    
http://github.com/penberg/jato/commit/6f76d8586618a09d7c8173b5aaff38b011436317
Author: Tomek Grabiec <tgrab...@gmail.com>
Date:   2009-12-16 (Wed, 16 Dec 2009)

Changed paths:
  M arch/x86/include/arch/memory.h
  M include/vm/gc.h
  M include/vm/thread.h
  M vm/gc.c
  M vm/signal.c
  M vm/thread.c

Log Message:
-----------
gc: rewrite GC stop-the-world algorithm.

Garbage collection is done in a separate thread.

Before the main GC work is started, thread creation and destruction
must be disabled and all mutator threads must be suspended. The
SIGUSR2 signal is sent to all threads. The signal handler determines
whether a thread is running JIT code or native code. In the former
case the handler returns to let the thread reach a safepoint. In the
latter case it is put into safepoint immediately.  When thread is
suspended in safepoint it waits for another SIGUSR2 signal which is
sent by the GC thread to wake threads up.

We must not use mutexes from signal handlers because
pthread_mutex_lock() is not reentrant. Using it from a signal handler
may result in a deadlock. This approach uses semaphores to notify GC
when a thread enters or leaves a safepoint.

[ penb...@cs.helsinki.fi: Remove dubious use of 'volatile' ]
Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
Signed-off-by: Pekka Enberg <penb...@cs.helsinki.fi>



------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to