Hi Tom,
Thank you again for the quick reply.
On July 4, 2016 Tom Poindexter wrote:
>> On Fri, Jul 01, 2016 at 01:58:19PM +0000, Brian Brooks (US) wrote:
>> Does tcl.lang.Interp support a design where multiple Interp's are thread bound to the same "Notifier" thread?
>> The Interp instances are not shared across threads, instead 1 Notifier thread "contains" multiple Interps.
>> Such a "reduced concurrency" design would simplify our application's threadsafety/locking code.
>
> It's been a while since I've looked into the gory details of the Notifier, perhaps the description from:
> http://tcljava.sourceforge.net/docs/TclJavaLib/Notifier.htm
> can shed some light on your questions.
I don't see in the Notifier JavaDoc any guarantees that a single Notifier primary thread can "contain/house" multiple Interp instances. These statements in the Notifier's JavaDoc leave undefined the Interp#getNotifier behavior when multiple Interps are constructed on the same "Notifier primary thread":
1. "Each Notifier instance is associated with a primary thread."
2. "Any thread can queue (or dequeue) events using the queueEvent (or deleteEvents) call."
3. "However, only the primary thread may process events in the queue using the doOneEvent call."
The statements do guarantee that multiple threads can enqueue TclEvents to a Notifier's event queue.
Reading the current tcl.lang.Interp constructor source code, Interp#getNotifier called on different Interp instances " contained/housed/constructed and accessed " on the Notifier's primary thread will always return the same Notifier instance; despite each Interp instance being a uniquely constructed object instance. Each Interp constructor call "lazily loads" its Notifier from the notifierTable of the Notifier class; but this notifierTable is only "keyed" by Thread rather than by both "the Interp and the Thread":
https://github.com/jtcl-project/jtcl/blob/master/src/main/java/tcl/lang/Interp.java#LL571
https://github.com/jtcl-project/jtcl/blob/master/src/main/java/tcl/lang/Notifier.java#LL142-158
Brian Brooks
Sr Software Engineer
Duluth, GA 30096
-----Original Message-----
From: Tom Poindexter [mailto:tpo...@ny...]
Sent: Monday, July 04, 2016 10:10 PM
To: A list for users of tcljava <tcl...@li...>
Subject: Re: [tcljava-user] JTCL Design Question: May 1 Notifier Thread Own Multiple tcl.lang.Interp instances?
It's been a while since I've looked into the gory details of the Notifier, perhaps the description from: http://tcljava.sourceforge.net/docs/TclJavaLib/Notifier.htm
can shed some light on your questions.
--
Tom Poindexter
tpo...@ny...
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San Francisco, CA to explore cutting-edge tech and listen to tech luminaries present their vision of the future. This family event has something for everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
tcljava-user mailing list
tcl...@li...
https://lists.sourceforge.net/lists/listinfo/tcljava-user
|