access: do not clone File object with postMessage()
Calling postMessage() on a object without specifying the transfer parameter is sending it using structured cloning. Adding File to transferList does not seem to be a good solution because then the file will only be available in the receiving end of postMessage(), if we can postMessage to only one pthread worker (with named threads for example), and making it available to multiple workers is not possible.
from the documentation :
The ownership of these objects is given to the destination side and they are no longer usable on the sending side.
In addition to that the current patch does a postMessage on all pthread workers, which I think is bad because it will make all the pthread workers heavier.
It would be better to use sharedArrayBuffer instead and asynchronously read into shared memory. (can't synchronously read in the main thread)
Problem: how do we make sure we can do synchronous reads in a pthread?
WIP: https://github.com/emscripten-core/emscripten/issues/14094