rusty_v8 icon indicating copy to clipboard operation
rusty_v8 copied to clipboard

Add Locker API

Open piscisaureus opened this issue 4 years ago • 6 comments

Fork of #738

piscisaureus avatar Sep 22 '21 20:09 piscisaureus

@SpencerSharkey - I'm not trying to steal your thunder here, but I thought I'd try to move #738 forward a bit.

piscisaureus avatar Sep 22 '21 21:09 piscisaureus

It is possible to obtain concurrent access to an Isolate from two different threads using the following route.

let mut isolate = Isolate::new(Default::default());
let handle = isolate.thread_safe_handle();

// On another thread:
let locker = &mut handle.lock();

That shouldn't be possible.

piscisaureus avatar Sep 29 '21 18:09 piscisaureus

Bug: If an IsolateHandle is created with v8::Isolate::new_handle, the underlying isolate is never dropped because drop_annex is never called and the Arc<IsolateAnnex> has a cycle. Additionally, there is no way to drop the annex using only the public API.

lbguilherme avatar Oct 03 '21 13:10 lbguilherme

Really looking forward for this to be done. 👍 Sadly not experienced enough to help with this myself ...

merlinfuchs avatar Dec 28 '21 10:12 merlinfuchs

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Jan 07 '22 16:01 CLAassistant

I just rebased this PR and fixed the tests again.

We are not merging this PR at this time because is has unaddressed safety issues and at least one memory leak. In Deno and Deno Deploy we don't need to access isolates from different threads so it's hard to evaluate whether this PR addresses the need.

We would appreciate help from the community to get this PR into a shape where we can land it.

piscisaureus avatar Jan 07 '22 18:01 piscisaureus

closing because stale.

ry avatar Nov 22 '22 15:11 ry