DH
> Where can I find a good squeletton of thread management...?
>
Tutorial on thread programming in Delphi
http://www.eonclash.com/Tutorials/Multithreading/MartinHarvey1.1/ToC.htm
l
http://www.sklobovsky.com/community/index.html
http://sklobovsky.nstemp.com/community/threadmare/threadmare.htm
http://sklobovsky.nstemp.com/community/threadmare/perks.htm
http://sklobovsky.nstemp.com/community/threadmare/fixes.htm
http://www.pergolesi.demon.co.uk/prog/threads/ToC.html
http://nimble.nimblebrain.net/delphi.html (downloads at bottom of page))
--
Peter Below (TeamB)
Don't be a vampire (http://slash7.com/pages/vampires),
use the newsgroup archives :
http://www.tamaracka.com/search.htm
http://groups.google.com
Just two questions :
1) Is it safe to call an external method from an overriden Execute ?
2) Is the terminology Modal and Modeless applyable to threads or processes ?
DH
> some links failed :
> http://www.pergolesi.demon.co.uk/prog/threads/ToC.html
That site seems to be completely gone for a while now.
Luckily it is available in the "wayback machine"
http://web.archive.org/web/20060305174604/http://www.pergolesi.demon.co.uk/prog/threads/ToC.html
And others have put a copy on their site:
http://www.eonclash.com/Tutorials/Multithreading/MartinHarvey1.1/ToC.html
--
Pieter
> Just two questions :
> 1) Is it safe to call an external method from an overriden Execute ?
That would depend on what that external method does, accessing "global"
data, VCL-stuff, etc? If that is the case you probably need some form
of synchronisation.
> 2) Is the terminology Modal and Modeless applyable to threads or
> processes ?
I'm not familiar with using the terms Modal and Modeless together with
threads and processes. These two words are linked in my head with Forms
and Dialogs.
--
Pieter
MultiTask/Exclusive ?
DH
> > > These two words are linked in my head with Forms
> >> and Dialogs.
> What do you call a process that could run blocking the system
Bad code.
> or when idle ?
Blocking the system when it is idle? A bug ;-)
> MultiTask/Exclusive ?
>
Not sure what you are looking for, maybe background, foreground tasks?
--
Pieter
The script have 4 states :
started
running --> that will loop through a TStringList holding user commands
stopped
ready
Actually, I just run that step by step...until its ready or in error...
What I want is the ability to run it :
- entirely --> looping step by step until ready/error
- entirely but in "background" -> execute a thread step by step
and terminate on
ready/error
So I implemented a Strategy property with values Modal/Modeless...
Not sure that's the correct words...
DH
> >> Not sure what you are looking for, maybe background, foreground
> tasks? I implemented a mini script processor as a sub property....
>
> - entirely --> looping step by step until ready/error
> - entirely but in "background" -> execute a thread step by step
> and terminate on ready/error
>
> So I implemented a Strategy property with values Modal/Modeless...
>
> Not sure that's the correct words...
RunAsThread: Boolean
UseThread: Boolean
UseBackgroundThread: Boolean;
ExecuteMode = (emBackground, emForeground);
...
Something like that?
--
Pieter
But I dont know why I preffer ExecuteMode = (emModal, emModeLess)
Are these words significant enough to You, as a developper ?
DH
No, not at all, I associate them with the GUI, like I said before with
forms/dialogs.
http://en.wikipedia.org/wiki/Mode_(computer_interface)
http://en.wikipedia.org/wiki/Dialog_box
Or in general type in "modal modeless" (without the quotes) in google
and see the results listed.
--
Pieter
> >> No, not at all, I associate them with the GUI, like I said before
> with >> forms/dialogs.
> http://en.wikipedia.org/wiki/Modal_window
>
> One of the Use Cases is :
> blocking the application flow until information required to continue
> is entered.
... by human interaction!
> So I assume that could be the same words for a Process executing a
> Script line by line, else as a thread, else as a blocking method...
IMO no, not for threaded vs non-threaded.
--
Pieter
One of the Use Cases is :
blocking the application flow until information required to continue is
entered.
So I assume that could be the same words for a Process executing a Script
line by line, else
as a thread, else as a blocking method...
DH
>> IMO no, not for threaded vs non-threaded.
Here are the words :
ExecuteMode = (emThread, emWait)
Is that correct ?
Just another thing :
How to set a property value such as a last update time just before it's
being saved and destroyed...?
DH
> >> IMO no, not for threaded vs non-threaded.
> Here are the words :
> ExecuteMode = (emThread, emWait)
>
> Is that correct ?
You got to ask yourself, what does emWait means? Wait for what?
> Just another thing :
>
> How to set a property value such as a last update time just before
> it's being saved and destroyed...?
private
FLastUpdateTime: TDateTime;
In your save routine:
FLastUpdateTime := Now;
--
Pieter
DH
> > > How to set a property value such as a last update time just before
> > > it's being saved and destroyed...?
> > In your save routine:
> Save routine ?
I assumed from your previous post that you did have a method /
function / procedure saving something.
If not, explain what and when you mean by "saved and destroyed".
--
Pieter
But never mind, my question was a non sense, as I just have to override the
DoAtChange method I implemented for being called at any change...
DH