nacl io availability when using postMessageAndAwaitResponse synchronous API

46 views
Skip to first unread message

mark.br...@gmail.com

unread,
Apr 20, 2015, 5:03:44 AM4/20/15
to native-cli...@googlegroups.com
Hi 
Are there limitations in nacl io when using the synchronous postMessageAndAwaitResponse JavaScript API. I'm trying to do a file copy synchronously and want to have JS wait for the copy to happen, however it appears that filesystem in nacl is blocked by the postMessageAndAwaitResponse call. If I use postMessage the copy works fine but using the synchronous version results in a copy error.

Thanks
Mark.

Ben Smith

unread,
Apr 21, 2015, 11:10:46 AM4/21/15
to native-cli...@googlegroups.com
Hi Mark,

What are the nacl_io filesystems involved in the copy? What thread are you calling the IO functions on? My guess is that what you're trying to do may be very tricky; the intent of postMessageAndAwaitResponse is to quickly return easily accessible data from the NaCl module to the JavaScript context. In general, blocking the JavaScript main thread will often make things not work properly. It is possible that is what you are experiencing.

-Ben

mark.br...@gmail.com

unread,
Apr 22, 2015, 3:09:21 PM4/22/15
to native-cli...@googlegroups.com
Hi Ben,
Thanks for replying. Copy is from memfs to html5fs (persistent) on the background thread setup for the messageHandler. I wouldn't normally perform file copies on a synchronous js call but we are trying to work around a couple of issues whilst still maintaining backwards compatibility with an existing api.
Regards
Mark.
Reply all
Reply to author
Forward
0 new messages