Sign in Join

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

Mailing lists / fpc-devel / 2005-11

Thread REVERT

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Ales Katona

Please remove ALL of my win32 thread patches(not the stacksize ones tho). Thanks to neli, I now know that ThreadFunc is not called directly by the OS, but my ThreadMain which already IS stdcall. My "bug" with threads was actualy cause by a -Ct (check stack) switch which in win32 always causes a runtime error 202 (stack overflow) because of the default value for stack size which is 0.

So to sum it up, no patches required, bug is not a bug but a feature(the feature should get fixed IMO but I have no idea how stack checking works)

Ales

Reply by email

Florian Klaempfl
to Ales Katona
Ales Katona wrote
Please remove ALL of my win32 thread patches(not the stacksize ones

Reverted.

Show quoted text 8 lines
tho). Thanks to neli, I now know that ThreadFunc is not called directly by the OS, but my ThreadMain which already IS stdcall. My "bug" with threads was actualy cause by a -Ct (check stack) switch which in win32 always causes a runtime error 202 (stack overflow) because of the default value for stack size which is 0. So to sum it up, no patches required, bug is not a bug but a feature(the feature should get fixed IMO but I have no idea how stack checking works)

Me neither, at least not in win32 threads :) Probably no stack checking required at all becuase windows does it.

Reply by email

Bogusław Brandys
to Florian Klaempfl
Florian Klaempfl wrote 21 lines
Ales Katona wrote: >Please remove ALL of my win32 thread patches(not the stacksize ones Reverted. >tho). Thanks to neli, I now know that ThreadFunc is not called directly >by the OS, but my ThreadMain which already IS stdcall. My "bug" with >threads was actualy cause by a -Ct (check stack) switch which in win32 >always causes a runtime error 202 (stack overflow) because of the >default value for stack size which is 0. > >So to sum it up, no patches required, bug is not a bug but a feature(the >feature should get fixed IMO but I have no idea how stack checking works) Me neither, at least not in win32 threads :) Probably no stack checking required at all becuase windows does it.

What about simply disabling such -Ct compiler switch (with nice error message) under Windows ? Or maybe it should "do nothing" under Windows ?

Regards
Boguslaw Brandys

Reply by email

Ales Katona
to Bogusław Brandys
Show quoted text 9 lines
What about simply disabling such -Ct compiler switch (with nice error message) under Windows ? Or maybe it should "do nothing" under Windows ? Regards Boguslaw Brandys

I have no idea how -Ct works. It seems there are also report(by Pavel to be more precise) that -Ct causes problems with threads in Linux too(Pavel uses his own thread manager so who knows..). Unless someone can explain to me how the stack checker knows the right size of stack it should be a rule to turn it off with threads. I'm actualy not sure wether -Ct works ok as-is.

Ales

Reply by email