On Mon, 19 Jun 2000, Jeff Sturm wrote:
> Mo DeJong wrote:
> > I am not sure what volatile has to do with anything. I was under the
> > impression those were for serialization.
>
> Volatiles are potentially useful because loads/stores are guaranteed to
> occur in order (if the VM is implemented correctly). There are certain
> idioms based on volatile that produce correct behavior in multithreaded
> code even without `synchronized' blocks.
Oh. Well, I think we want to avoid anything wacky like that.
If it not not implemented everywhere, than we should avoid it.
> > GC in the Tcl core would be really cool. Lets face it, all those
> > incr and decr ref counts are hard to use. If you forget one, BLAMO!
> > You code dies and you need to go figure out where things got hosed.
>
> Yep. I do have GC patches for 8.3.1, if anyone is brave and/or
> desperate...
I would like to play around with it at some point in the future,
but not for anything related to Tcl/Java.
> > Lets focus on how we can implement a thread safe JNI method
> > that will store a list of Tcl internal reps that need to be
> > freed by the Tcl interp. We need to do this in such a way
> > that all Java refs for that object are dropped from the
> > Tcl side without calling any other JNI or Tcl methods.
>
> OK, how do you want to proceed? I'm thinking about thin locks, but I
> don't know how they can be done portably and reliably. SPARC users can
> use ldstub, for example...
What is a "thin lock"? Did you mean spin lock? I don't see what is
wrong with a good old mutex, but putting one in means we would
need to require a thread safe version of Tcl. I don't really
like the "use the JVM to do locking" hacks in there now. Using
the JVM to do locking in a JVM finalizer seems like a really
bad idea.
later
Mo DeJong
Red Hat Inc
----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe: send mail to [EMAIL PROTECTED]
with the word SUBSCRIBE as the subject.
To unsubscribe: send mail to [EMAIL PROTECTED]
with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'.
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com