Hi Brad,
Unfortunately, background thread stuff isn't implemented yet. I would
look for that late this year. This means there's no official way to
read files synchronously using the Pepper API.
NaCl may have a way to do this with C stdlib style calls, maybe
somebody who's more familiar with that can chime in.
If that doesn't work and you really need this to make your code work,
the way to do this is to write your own asynchronous code on the main
thread that makes the call synchronous on the background thread where
your code is running. Sorry this isn't easier yet.
Brett
look for that late this year. This means there's no official way toUnfortunately, background thread stuff isn't implemented yet. I would
read files synchronously using the Pepper API.
NaCl may have a way to do this with C stdlib style calls, maybe
somebody who's more familiar with that can chime in.
It was my understanding that we intend to support *most* synchronous calls to PPB_FileIO from a NaCl module for M14. I believe that Open will not be supported though.
On Wed, Jul 13, 2011 at 8:38 PM, Darin Fisher <da...@chromium.org> wrote:It was my understanding that we intend to support *most* synchronous calls to PPB_FileIO from a NaCl module for M14. I believe that Open will not be supported though.And this is exactly what the GLibC needs. Low-level and ubiquitous functions like printf or pthread_cancel need synchronous, thread-safe open syscall. Granted: it's only on slow pass when you call them the first time (or when something significant like "system locale" changes) so you can try to survive without synchronous open() call but this is so, sooo, fragile.
(Also, please note that functions that synchronous calls to PPB_FileIO will only be supported from a background thread. They are not supported on the main thread.)
--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To post to this group, send email to native-cli...@googlegroups.com.
To unsubscribe from this group, send email to native-client-di...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/native-client-discuss?hl=en.
The plan is to eventually support the entire Pepper API on background threads. The API was designed as such. There will never be support for synchronous File IO on the main thread though.
On Thu, Jul 14, 2011 at 10:02 AM, Victor Khimenko <kh...@google.com> wrote:On Thu, Jul 14, 2011 at 8:31 PM, Darin Fisher <da...@chromium.org> wrote:The plan is to eventually support the entire Pepper API on background threads. The API was designed as such. There will never be support for synchronous File IO on the main thread though.This will mean most stdlib functions will be forbidden on main thread (including printf, etc). We'll see how it'll work when we'll reach this state.Right. Although, one could imagine exposing a PPB_Console interface that provides for things like stdout. Imagine if printf were hooked up to the developer tools console!-Darin
Actually, you don't need to imagine it. We already have PPB_Console_Dev::Log :-)
Sorry, looks like it is not proxied yet. For now, you would need to use PostMessage, and then call console.log from JS :-(