Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Threads...

5 views
Skip to first unread message

David HAROUCHE

unread,
Jun 5, 2008, 8:30:37 PM6/5/08
to
Where can I find a good squeletton of thread management...?

DH


Peter Below (TeamB)

unread,
Jun 6, 2008, 1:30:48 AM6/6/08
to

David HAROUCHE

unread,
Jun 6, 2008, 7:13:42 AM6/6/08
to

David HAROUCHE

unread,
Jun 6, 2008, 7:56:58 AM6/6/08
to
Thanks...

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


Pieter Zijlstra

unread,
Jun 6, 2008, 7:41:17 AM6/6/08
to
David HAROUCHE wrote:

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

Pieter Zijlstra

unread,
Jun 6, 2008, 8:48:02 AM6/6/08
to
David HAROUCHE wrote:

> 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

David HAROUCHE

unread,
Jun 6, 2008, 9:00:38 AM6/6/08
to
>>These two words are linked in my head with Forms
>> and Dialogs.
What do you call a process that could run blocking the system or when idle ?

MultiTask/Exclusive ?

DH


Pieter Zijlstra

unread,
Jun 6, 2008, 9:05:19 AM6/6/08
to
David HAROUCHE wrote:

> > > 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

David HAROUCHE

unread,
Jun 6, 2008, 12:18:45 PM6/6/08
to
>> Not sure what you are looking for, maybe background, foreground tasks?
I implemented a mini script processor as a sub property....

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


Pieter Zijlstra

unread,
Jun 6, 2008, 4:54:03 PM6/6/08
to
David HAROUCHE wrote:

> >> 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

David HAROUCHE

unread,
Jun 6, 2008, 7:03:14 PM6/6/08
to
>> ExecuteMode = (emBackground, emForeground);
>> Something like that?
Yes

But I dont know why I preffer ExecuteMode = (emModal, emModeLess)

Are these words significant enough to You, as a developper ?

DH


Pieter Zijlstra

unread,
Jun 6, 2008, 7:08:23 PM6/6/08
to
David HAROUCHE wrote:

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

Pieter Zijlstra

unread,
Jun 6, 2008, 7:25:44 PM6/6/08
to
David HAROUCHE wrote:

> >> 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

David HAROUCHE

unread,
Jun 6, 2008, 7:21:05 PM6/6/08
to
>> 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.

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


David HAROUCHE

unread,
Jun 6, 2008, 7:37:13 PM6/6/08
to
>> ... by human interaction!
Right !

>> 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


Pieter Zijlstra

unread,
Jun 6, 2008, 7:39:50 PM6/6/08
to
David HAROUCHE wrote:

> >> 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

David HAROUCHE

unread,
Jun 6, 2008, 7:53:21 PM6/6/08
to
>> In your save routine:
Save routine ?

DH


Pieter Zijlstra

unread,
Jun 6, 2008, 7:57:38 PM6/6/08
to
David HAROUCHE wrote:

> > > 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

David HAROUCHE

unread,
Jun 6, 2008, 8:11:00 PM6/6/08
to
>> If not, explain what and when you mean by "saved and destroyed".
Its about a sub-property inherited from TPersistent, within a TComponent...

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


0 new messages