Dave
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
Hi Dave,
> So what I think you're saying is that if I'm calling a function of some 3rd party library for example, I don't know that it isn't spawning a thread so can't assume it's going to finish
That's right AND that's by design! If you think about the following problem:
Writing a buffer to disk. How to program this ? Has your main thread really to wait for the completion or can you
return earlier before the actual write is done? is it transparent to the user? do you know what winows really does when you write something to disk???
Agreed, but this is an obvious example that I would have understood and taken into consideration.
> before it returns? But how about standard Delphi pascal code? Can I assume that things are synchronous there for the most part? I can't think of a specific example, I just had
> doubts raised several times that that was what was really happening. I couldn't think of a good way to test it besides using SendMessage or PostMessage. I wasn't even
> considering multi-threading applications, just the regular single thread. Thanks.
Delphi and the Os (windows) are talking to each other with messages. Whenever Delphi sends a message the associated command/function is
not executed immediately (with some few exceptions like WM_QUIT) but it is put into a queue and worked on later (and sometimes
in a different order). So when you put an item into a listbox (which is done via a message!) the update of the lb is postponed until your application
is not busy (so to minimize screen-updates) Especially when debugging code there might be some strange results (and hangings) when your
breakpoint is reached, the ide pops up and overrides your listbox which implies that it has to be re-drawn which will call every OnDraw-event
again. Nice, if the breakpoint is located exactly there!
But you can be dammned sure, that under normal (never use "normal" and "Windows" in the same sentence!!!) circumstances
everything will run correctly! Although your'e running some hundred threads simultaneously.
Things tend to get interesting, when you drop in, the programmer: I lerarned a lot of stuff concerning threads when I started
to send messages to some of my windows myself.
Happy coding!
Bob
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
SPONSORED LINKS
C programming language Computer programming languages Java programming language The c programming language C programming language Concept of programming language
---------------------------------
YAHOO! GROUPS LINKS
Visit your group "delphi-en" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
[Non-text portions of this message have been removed]
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
YAHOO! GROUPS LINKS
- Visit your group "delphi-en" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

