Luca Olivetti wrote:
> I wasn't actually interested in updating the counter, it was just a test
> to see if while I was sleeping ;-) the LCL became automagically thread
> safe :-D  [*] (I still remember the shock when I wrote my first delphi
> 2.0 heavily multithreaded application only to discover that it didn't
> work at all because the VCL wasn't thread-safe).

The VCL was not and is not thread-safe, and neither is the LCL.

Do you know why?

> e.g. I also tested adding lines to a memo directly from the thread with
> no apparent problems.

Pure chance.

> [*]in fact, a couple of years ago, when I lastly used lazarus for a
> project, if I used synchronized the program did't work at all (IIRC
> either it would lock or the synchronized method was triggered more than
> once), so I just boldly avoided using synchronize. I don't remember the
> exact details, so it may just have been a fringe case where synchronize
> wasn't actually needed[**]. It's a simple program but it's been running
> unattended 24 hours a day since then.
>
> [**]Ok, I looked again at that old code and I cheated: the access to the
> data was protected with a critical section, but I'm pretty sure I
> avoided synchronize because it didn't work right at the time.

Have you found a problem with synchronize now?


Thanks!

--
Al

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to