

|
 |
| << Topic |
< Post |
Post 7 of 24 Topic 5165 of 5187
|
Post > |
Topic >> |
Re: TThread, Terminate, Boolean, Alignment ???
by "Skybuck Flying" <BloodyShame@[EMAIL PROTECTED]
>
Oct 14, 2008 at 07:36 PM
| What the **** ?!?!
Outlook express completely messed up the last message ?!?!
Wow what the **** ?!?
Let's try that again:
It's amazing how my brain manages to solve problems while I am asleep.
"Yesterday" I was tired and I didn't see the problem.
"Today" I wake up and immediatly understand the problem.
At least I think so...
Problem description:
There are two threads:
ThreadMain
ThreadTest
The code which they execute is
(which I will put side-by-side, for illustration):
ThreadMain ThreadTest
begin begin
ThreadTest.Terminate; while not Terminated do
ThreadTest.WaitFor; begin
ThreadTest.Free; end;
end; end;
The order in which these statements are executed is probably what is
causing
the problem in rare cases.
The rare case would be:
1. ThreadMain ThreadTest.Terminate;
2. ThreadTest.while not Terminated do
3. ThreadMain ThreadTest.WaitFor;
So you see the problem now ?
I do, the problem is:
First ThreadMain tells ThreadTest to terminate, then ThreadTest immediatly
terminates.
Then ThreadMain tries to wait for ThreadTest to terminate... but it
already
terminated ?!
So ThreadMain waits forever on ThreadTest to terminate !
That's why it can never work ?!
So if I am correct about this then CodeGear has had a bug in there thread
code up to this day....
Which is about 10 years or so ?!
This bug is still in Delphi 2009 ?! WOW.
Which more or less proves how difficult it can be to find/detect bugs.
^^^ Probably caused by their bad testing as well ;) :) ^^^
I solved this with a critical section for the terminated boolean...
Maybe there is a better/more efficient solution ???
On a side note:
I left my computer running the whole "night" because it's downloading
Brother in Arms: Hells highway :)
Also Call of Duty 5 will come out 8 days from now ? So that gonna be fun
too
lol. Gonna be busy gaming weeks :)
Anyway something happened to my computer when I was a sleep and
downloading
with BitComet 0.63 or so:
BitComet is still working... but Explorer.EXE crashes with an unknown
exception... probably in the .NET section or so ;)
I hope my computer didn't get hacked or infected ;) Maybe it was just a
failed hack attempt but this shows Windows X64 still has some serious bugs
here and there... (Explorer.exe hangs sometimes too...)
I restarted explorer.exe so now everything is fine...
Today Microsoft is probably gonna patch some holes... I always wait a
little bit with patching the operating system with new patches... One
never
knows how that works out... sometimes people have problems with new
patches
so that's why I always wait a few days or weeks... to know if the patches
work ok or not ok ;) :)
Bye,
Skybuck ! =D


|
24 Posts in Topic:
|
"Skybuck Flying" |
2008-10-14 12:19:39 |
|
Szabolcs Ferenczi <sza |
2008-10-14 03:50:11 |
|
"Skybuck Flying" |
2008-10-14 19:33:26 |
|
David Schwartz <davids |
2008-10-14 04:49:57 |
|
"Chris M. Thomasson& |
2008-10-14 13:50:52 |
|
"Skybuck Flying" |
2008-10-14 19:30:38 |
|
"Skybuck Flying" |
2008-10-14 19:36:00 |
|
"Skybuck Flying" |
2008-10-14 19:38:46 |
|
"Skybuck Flying" |
2008-10-14 19:40:44 |
|
"Skybuck Flying" |
2008-10-14 19:51:22 |
|
"Skybuck Flying" |
2008-10-14 19:51:56 |
|
"Skybuck Flying" |
2008-10-14 19:57:37 |
|
"Skybuck Flying" |
2008-10-14 20:55:38 |
|
Rob Kennedy <me3@[EMAI |
2008-10-14 14:12:10 |
|
"Skybuck Flying" |
2008-10-14 21:58:09 |
|
"Skybuck Flying" |
2008-10-15 01:30:16 |
|
"Skybuck Flying" |
2008-10-15 04:17:12 |
|
"Skybuck Flying" |
2008-10-15 04:19:51 |
|
"Skybuck Flying" |
2008-10-15 04:37:46 |
|
"Nicholas Ring" |
2008-10-15 21:12:44 |
|
David Schwartz <davids |
2008-10-14 18:31:57 |
|
"Chris M. Thomasson& |
2008-10-15 19:55:49 |
|
"Chris M. Thomasson& |
2008-10-15 21:42:35 |
|
"Chris M. Thomasson& |
2008-10-15 21:46:57 |
|
Post A Reply:

|
|
|
|