Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-01

Threading / Synchronization

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Pedro Lopez-Cabanillas

Hi,

The attached program works well under Linux when compiled with Kylix3. It counts from 1 to 10 and ends. FPC compiles it, but doesn't work (loops forever). Seems that CheckSynchronize doesn't work (or perhaps TThread.Synchronize?).

Another issue: CheckSynchronize has in Kylix3 an optional parameter (Timeout: Integer = 0), not available in FPC.

Regards,
Pedro

Reply by email

Johannes Berg
to Pedro Lopez-Cabanillas
Pedro Lopez-Cabanillas wrote
The attached program works well under Linux when compiled with Kylix3. It counts from 1 to 10 and ends. FPC compiles it, but doesn't work (loops forever). Seems that CheckSynchronize doesn't work (or perhaps TThread.Synchronize?).

Afaik this hasn't been implemented (yet). I (re)wrote some threading stuff but couldn't finish it.

Another issue: CheckSynchronize has in Kylix3 an optional parameter (Timeout: Integer = 0), not available in FPC.

Which is, I think, ignored and only there for windows compatibility. But I'm not sure at all, could you check? [Though OTOH, it shouldn't be too hard to implement given the scheme neli and I discussed on #fpc]

johannes

Reply by email

Vincent Snijders
to Pedro Lopez-Cabanillas: The attached program works well under Linux when compiled with Kylix3. It counts from 1…
Pedro Lopez-Cabanillas wrote 9 lines
Hi, The attached program works well under Linux when compiled with Kylix3. It counts from 1 to 10 and ends. FPC compiles it, but doesn't work (loops forever). Seems that CheckSynchronize doesn't work (or perhaps TThread.Synchronize?). Another issue: CheckSynchronize has in Kylix3 an optional parameter (Timeout: Integer = 0), not available in FPC.

Micha Nelissen took a look at it and said:

Does it work, if you remove the call to sleep, just before CheckSynchronize? Or change it to sleep(1) and observe it prints 1 2 3 4 every second.

Vincent.

Reply by email

Pedro Lopez-Cabanillas
to Johannes Berg: Afaik this hasn't been implemented (yet). I (re)wrote some threading stuff but couldn't…
Johannes Berg wrote 8 lines
On So, 2005-01-16 at 23:36 +0100, Pedro Lopez-Cabanillas wrote: > The attached program works well under Linux when compiled with Kylix3. It > counts from 1 to 10 and ends. FPC compiles it, but doesn't work (loops > forever). Seems that CheckSynchronize doesn't work (or perhaps > TThread.Synchronize?). Afaik this hasn't been implemented (yet). I (re)wrote some threading stuff but couldn't finish it.

TThread.Synchronize support has been announced as a new feature on FPC 1.9.6 See: ftp://ftp.freepascal.org/pub/fpc/beta/whatsnew.txt

Show quoted text 6 lines
> Another issue: CheckSynchronize has in Kylix3 an optional parameter > (Timeout: Integer = 0), not available in FPC. Which is, I think, ignored and only there for windows compatibility. But I'm not sure at all, could you check? [Though OTOH, it shouldn't be too hard to implement given the scheme neli and I discussed on #fpc]

The timeout parameter is undocumented in Kylix3, but it is not ignored. It sleeps the given amount of time (in milliseconds) except if there is a pending synchronize call already waiting.

I also understand that only documented features should be implemented for compatibility, and I can live without this feature.

Regards,
Pedro

Reply by email