KIO question - synchronous IO?

Maciej Stachowiak mjs at apple.com
Wed Nov 19 07:48:26 CET 2003


On Nov 18, 2003, at 10:39 PM, David Faure wrote:

> On Tuesday 18 November 2003 22:15, Leo Savernik wrote:
>> Am Dienstag, 18. November 2003 21:55 schrieb Maciej Stachowiak:
>>> Does KIO have a way to execute a job synchronously, or otherwise do
>>> sync I/O? I think I will need this for the sync loading feature of
>>> XMLHttpRequest. If not, I can do that part of it in #ifdef
>>> APPLE_CHANGES for now. (Yes, I know it's terrible to let a script do
>>> sync I/O, Microsoft designed it, not me.)
>>
>> KIO::NetAccess simulates synchronous operations by (mis)using the Qt 
>> event
>> loop.
>
> Yes - I would have suggested this first, as well.
> But thinking about it, there's no need for a C++ function to be 
> synchronous here,
> all that matters is that a JS function appears to be synchronous.
> So maybe one could pause the interpreter, set up signals and slots to 
> the KIO Job,
> and when the job completes, resume the interpreter from the slot, and 
> the JS function
> will then return. This would be much cleaner than a NetAccess hack.

I think this would be a great long-term solution. But I don't think it 
is currently possible to pause kjs execution at an arbitrary point in 
the JavaScript code and then resume later. Much of the current 
execution state is represented by the C/C++ call stack.

If there's something I've missed though, I'd really like to hear it.

Regards,
Maciej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2355 bytes
Desc: not available
Url : https://mail.kde.org/mailman/private/khtml-devel/attachments/20031118/cddc5666/smime-0001.bin


More information about the Khtml-devel mailing list