[Info-vax] Apache + mod_php performance
Arne Vajhøj
arne at vajhoej.dk
Tue Oct 1 22:42:36 EDT 2024
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
More information about the Info-vax
mailing list