Re: ABCL in a multi-threading environment
Vibhu Mohindra <[email protected]> Thu, 19 Sep 2024 15:03:51 +0200
| Newsgroups | gmane.editors.j.devel |
|---|---|
| Message-ID | <c5c59627-e341-4f95-a47a-94408148d07c__48324.8927559302$1726751083$gmane$org@gmail.com> |
Yes, ABCL threads are Java threads underneath. Store the per-thread data in a java.lang.ThreadLocal variable, then it will be garbage collected when the thread ends. (If Thread A may want to access Thread B's per-thread data, then that'll need more thought.) The bordeaux-threads library's MAKE-LOCK creates a Java ReentrantLock. Follow the usual rules for portably and correctly accessing data from multiple threads. https://www.cs.umd.edu/~pugh/java/memoryModel/jsr-133-faq.html Vibhu