GC incremental
Bryce McKinlay
bryce@waitaki.otago.ac.nz
Sat Sep 29 21:19:00 GMT 2001
Boehm, Hans wrote:
> To get it to work reliably, someone would have to
>make a pass through libgcj, and make sure that all system calls which write
>to the heap are suitably wrapped, so that they don't see protection faults
>while excuting the system call.
>
Now I remembered what the problem is with the protected heap. In
os_dep.c the read() wrapper looks like this:
ssize_t __wrap_read(int fd, void *buf, size_t nbyte)
{
int result;
GC_begin_syscall();
GC_unprotect_range(buf, (word)nbyte);
result = __real_read(fd, buf, nbyte);
GC_end_syscall();
return(result);
}
The GC_begin_syscall() aquires the global allocation lock, effectivly
making all IO single-threaded. Why is that neccessary and can we avoid
it? Also why is the wrapping neccessary anyway? Is it just that kernal
writes to the heap dont get noticed by the GC, or is it more serious
than that?
regards
Bryce.
More information about the Java
mailing list