Hi,
Tried to create multiple instance of v8 in my process using isolate.
In Thread A i have the following code. (this is a worker thread and the
following code is called only when there is update in the javascript)
v8::Isolate* isolate2 = v8::Isolate::New();
{
v8::V8::Initialize();
v8::Locker l(isolate2);
v8::Isolate::Scope isolate_scope(isolate2);
v8::HandleScope handle_scope;
....
// script is compiled here
}
In thread B
{
if(v8::Locker::IsActive())
{
std:: cout << "Active" << std::endl;
}
v8::HandleScope handle_scope;
//Context scope
//Run the script
}
I get following error
Fatal error in HandleScope::HandleScope
# Entering the V8 API without proper locking in place
The check for IsActive is true. Since these are two instance of v8. One
with isolate2 and other with default isolate why is the lock active after
the thread A is executed?
On Friday, March 8, 2013 7:24:15 PM UTC+5:30, Neha wrote:
> Hi,
>
> i have a C++ application that at run time receives javascript which is as
> follows:
> if (condition 1 && condition 2)
> {
> if(condition)
> {
> true;
> }
>
> false;
> }
>
> I compile this javascript in a worker thread and update the datastructure
> that holds the compiled javascript.
>
> In my main thread, i try to run the v8 compiled script.
>
> I have to use locker and isolate as i have two threads running which are
> using v8. First thread to compile the javascript and main thread to run the
> script.
> My application is a low latency application. The execution speed should be
> very fast. Because i am using isolate, the speed of execution reduces.
>
> Is there any other way in which i can do this using v8?
> Can i have two instance of v8 in the same process?
>
> Any help would be appreciated. Thanks!
>
>
>
--
--
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.