Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-11 Thread Elijah Stone
It seems your primary question has been answered. I will add: I strongly suggest using a conjunction to lock your mutex; something similar to what I demonstrated in the 'unwind protect' thread, as the alternative is pretty much impossible to get right in the general case. On Tue, 10 May 2022,

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-11 Thread Elijah Stone
How practical is it to make jqt thread safe? Even just slapping a big mutex over everything? Is qt itself not threadsafe, or just jqt? On Wed, 11 May 2022, bill lam wrote: Jqt isn't thread safe. You should call to jqt from the main thread only. I am also unsure if calling smoutput or other

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Devon McCormick
Thanks, Bill and Henry. Using a non-JQt image reader seems to have done the trick. I will add this to my multi-threading notes. On Tue, May 10, 2022 at 9:42 PM Henry Rich wrote: > read_image is not defined for me, nor is readimg_jqtide_. > > Henry Rich > > > > On 5/10/2022 8:13 PM, Devon McCorm

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Henry Rich
read_image is not defined for me, nor is readimg_jqtide_. Henry Rich On 5/10/2022 8:13 PM, Devon McCormick wrote: It's the "read_image_" line that seems to be where it hangs up for me, on the fourth line from the end with the comment "¡Fails here!". The invocation (for 5 threads) is: mtFileWo

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread bill lam
Jqt isn't thread safe. You should call to jqt from the main thread only. I am also unsure if calling smoutput or other interactions with jqt session from JE user thread is safe or not. echo or smoutput in jconsole session is ok. You can try using jpeg or png addon to read image. Please let me kno

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Devon McCormick
It's the "read_image_" line that seems to be where it hangs up for me, on the fourth line from the end with the comment "¡Fails here!". The invocation (for 5 threads) is: mtFileWork t. '' MUTEX [ mtFileWork t. '' MUTEX [ mtFileWork t. '' MUTEX [ mtFileWork t. '' MUTEX [ mtFileWork t. '' MUTEX On T

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Henry Rich
What do I run to make it fail? Henry Rich On 5/10/2022 6:01 PM, Devon McCormick wrote: Henry, Here is the MVF - minimum viable failure. It looks like the culprit is "read_image" which is just a cover for "readimg_jqtide_". I'm running under jconsole. Set up in a directory with some .JPG file

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Devon McCormick
Henry, Here is the MVF - minimum viable failure. It looks like the culprit is "read_image" which is just a cover for "readimg_jqtide_". I'm running under jconsole. Set up in a directory with some .JPG files: FLS=: 0{"1 dir '*.jpg' createThreads 5 MUTEX=: 10 T. 1NB. Recursive mutex;

Re: [Jprogramming] Mutex with multi-threading primitive

2022-05-10 Thread Henry Rich
If you can get me a version that fails on Windows I'll look at it. Henry Rich On 5/10/2022 4:20 PM, Devon McCormick wrote: Hi, Has anyone had success using the multi-threading mutex primitives? I've had limited success - I'll be presenting some basic routines at NYCJUG this evening (18:00 EDT