Hi,
I have a few questions around this:
1) Do we need a pthread_mutex_lock and pthread_mutex_unlock in every access to ArrayBuffer->GetBackingStore? In the absence of a deep dive into the code (which I will do soon hopefully) I am guessing this is in case the GC, which is running on another thread, has moved the backing data elsewhere.
2) If i want to access backing data at high frequency from JS (e.g. doing lots of writing or reading of an arraybuffer on a socket) is it possible (or advisable) to do something like this in order to avoid the lock contention in GetBackingStore?
https://gist.github.com/billywhizz/ff4c83c37142198d2e70992e438bf045#file-test-cc. i.e. cache the pointer to the backing data in an internal field, assuming it will not be moved.
3) If the approach in 2) is not possible, is there a known approach to this problem which can avoid all the syscall overhead of locking the mutex?
If you need more info or something easy to reproduce please let me know.
Many Thanks,
Andrew