Re: [fpc-other] Felipe: Java and multi-threading

2017-05-26 Thread Graeme Geldenhuys
On 2017-05-26 15:56, Graeme Geldenhuys wrote: Attached is the corrected version of your sample application without the volatile keyword. It is worth noting that using volatile is faster, but also has its limits (ie: you can't protect a whole block of code or actions). To add to this, there is

Re: [fpc-other] Felipe: Java and multi-threading

2017-05-26 Thread Graeme Geldenhuys
Hi Felipe, > This simple program never ends if you delete the volatile keyword (I > tested here in Windows): Yes, I got the same behaviour as you, using Java 1.8 under FreeBSD. But I immediately saw your problem. You are accessing the same data from more than one thread. That has always been