Hi,

I have put some details here on an issue i have come across while doing 
some 
benchmarking: 
https://gist.github.com/billywhizz/ff4c83c37142198d2e70992e438bf045

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

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/a4ea069b-4271-4590-af99-4446a6a041e4n%40googlegroups.com.

Reply via email to