This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: GC incremental


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]