Sujet : Re: Apache + mod_php performance
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vmsDate : 02. Oct 2024, 03:42:36
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <66fcb31c$0$716$14726298@news.sunsite.dk>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
User-Agent : Mozilla Thunderbird
On 10/1/2024 10:21 PM, Lawrence D'Oliveiro wrote:
On Tue, 1 Oct 2024 20:50:30 -0400, Arne Vajhøj wrote:
On 10/1/2024 8:46 PM, Lawrence D'Oliveiro wrote:
On Tue, 1 Oct 2024 19:46:53 -0400, Arne Vajhøj wrote:
But any time one need to do anything time consuming in the GUI then it
needs to be done in its own thread ...
>
Note that “cpu-intensive” and “time-consuming” are not synonymous.
Something can take a long time to complete, but not require much CPU
time during that time, so running it in the main thread would be fine
and have minimal impact.
>
But how do you keep the GUI responsive if the event/main loop is doing
something that is time consuming??
The task waiting for the operation to complete blocks on a notification
back from the event loop that it can proceed.
Now you have confused me again.
We had:
* some time consuming task that need to run
* some unrelated GUI events that need to be processed in the event loop
And now you say that the thread instead of blocking on the task block
waiting for a notification from the event loop.
I don't get that.
The first two look like:
while(has_next_event())
{
ev = get_next_event()
switch(ev.event_type)
{
case START_LONG_RUNNING:
call calculate_all_primes_in_int64_and_display_count()
break
case SOMETHING_ELSE:
call handle_something_else()
break
}
}
which hangs the GUI.
So you do what?
Arne