process messages

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

process messages

news.unimaas.nl
I just received Dolphin Companion. Nice book.
I trying something that takes some time to compute and want to make sure
that the process doesn't eat all the processor time.

In Delphi there a command "processMessages" (or something like that).
Is there an equivalent in Dolphin?

-Leo-


Reply | Threaded
Open this post in threaded view
|

Re: process messages

Bill Schwab
Leo,

> I just received Dolphin Companion. Nice book.
> I trying something that takes some time to compute and want to make sure
> that the process doesn't eat all the processor time.
>
> In Delphi there a command "processMessages" (or something like that).
> Is there an equivalent in Dolphin?

Generally you'd use something like

[
    "Time-consuming code here"

] forkAt:Processory userBackgroundPriority

There are a few cautions though: external calls will block all of Dolphin
unless they are made with the "overlap" keyword, which runs them on a
separate OS thread.  You might also want to introduce a delay between
iterations in a tight loop.  Whether using Dolphin's "lightweight" threads
or at the OS level, multi-threaded programming introduces new challenges
that deserve respsect.  The Wiki has some information

  http://www.object-arts.com/wiki/html/Dolphin/MultipleThreads.htm


Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: process messages

Leo Plugge
Thanx Bill, I'll take a look at the multiple threads information.
-Leo-

"Bill Schwab" <[hidden email]> wrote in message
news:a2d01m$kh5$[hidden email]...

> Leo,
>
> > I just received Dolphin Companion. Nice book.
> > I trying something that takes some time to compute and want to make sure
> > that the process doesn't eat all the processor time.
> >
> > In Delphi there a command "processMessages" (or something like that).
> > Is there an equivalent in Dolphin?
>
> Generally you'd use something like
>
> [
>     "Time-consuming code here"
>
> ] forkAt:Processory userBackgroundPriority
>
> There are a few cautions though: external calls will block all of Dolphin
> unless they are made with the "overlap" keyword, which runs them on a
> separate OS thread.  You might also want to introduce a delay between
> iterations in a tight loop.  Whether using Dolphin's "lightweight" threads
> or at the OS level, multi-threaded programming introduces new challenges
> that deserve respsect.  The Wiki has some information
>
>   http://www.object-arts.com/wiki/html/Dolphin/MultipleThreads.htm
>
>
> Have a good one,
>
> Bill
>
> --
> Wilhelm K. Schwab, Ph.D.
> [hidden email]
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: process messages

Paul Hudson
In reply to this post by Bill Schwab
"Bill Schwab" <[hidden email]> wrote in
news:a2d01m$kh5$[hidden email]:

> http://www.object-arts.com/wiki/html/Dolphin/MultipleThreads
> .htm

That seems to have been truncated, ending with:

"You've run into a couple of interesting issues. First, you would not fork a"

Any chance it could be restored?

P.


Reply | Threaded
Open this post in threaded view
|

Re: process messages

Bill Schwab
>
> > http://www.object-arts.com/wiki/html/Dolphin/MultipleThreads
> > .htm
>
> That seems to have been truncated, ending with:
>
> "You've run into a couple of interesting issues. First, you would not fork
a"

You mean somebody actually reads this stuff?!?! :)


> Any chance it could be restored?

Done, sorta.  I put back an older copy I had saved, and even that's not
perfect because I had only the Wiki's html output.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: process messages

Paul Hudson
"Bill Schwab" <[hidden email]> wrote in
news:a2eskq$1vl$[hidden email]:

> You mean somebody actually reads this stuff?!?! :)

Religiously (i.e. once a week, on Sundays :-)

P.