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]
Other format: [Raw text]

Re: ATTN Windows Users: RFC - GCJ/MinGW and Thread-Safe Exception Handling


> Even though that is the case today because of a limitation in
> boehm-gc, it would be better not to make such assumptions. One day -
> according to Hans - it should be possible to create threads outside of
> libgcj and still have them aall into libgcj and allocate java objects
> without crashing.

Okay, this is all starting to come back to me now.

If that is an absolute requirement (be able to throw Java exceptions
in direct-OS-call-spawned-threads), then unless the Win32 API has
changed, you have no choice but to either link to a DLL (which cannot
be statically linked) or else leak a few bytes per spawned thread.

The exception handling mechanism needs that space to hold the SJLJ
state, and the number of threads is variable, so this space must be
malloc()ed.  If you don't know when the thread dies, you can't
deallocate that space.

  - a


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