Won't a synchronous XHR block/freeze the browser loop though? This is for 
potential multi-second downloads. As far as I understood asyncify it allows 
to return control to the browser loop and resumes at the specific position 
down in the call-stack? 

Will this add general performance overhead for all code, or only when and 
where an 'asyncify block' is active?

Thanks,
-Floh.

Am Montag, 3. November 2014 20:12:37 UTC+1 schrieb Alon Zakai:
>
> One option here is to do a synchronous XHR. This will not work on binary 
> data though, so it adds overhead, and there are cross-browser compatibility 
> issues.
>
> The other is to use something like asyncify (experimental but works now) 
> or the emterpreter (experimental and doesn't work yet). Both add 
> significant overhead though, so the first option might be better.
>
> - Alon
>
>
> On Mon, Nov 3, 2014 at 10:17 AM, Floh <[email protected] <javascript:>> 
> wrote:
>
>> Hi,
>>
>> for some reason I didn't pay that much attention to the asyncify and 
>> emscripten_yield() stuff since in the small, new experimental engine code I 
>> wrote more recently I avoided the need for blocking by design. But I'd like 
>> to go back attempting to port big legacy code bases, and synchronous IO 
>> calls was one of the main-'blockers' (excuse the pun).
>>
>> What I would actually need is some synchronous version of 
>> emscripten_wget_data() which downloads raw bytes without putting them into 
>> the 'virtual file system'. Is this planned for the near future, or should I 
>> attempt to write my own? If the latter, any tips and experiences to share?
>>
>> I'm not sure what the API would look like, I think the function can still 
>> have the onload and onerror callbacks, but would only return after either 
>> of the callback had been called?
>>
>> Cheers,
>> -Floh.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "emscripten-discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to