Hi, Thanks. I've found the same solution while "looking" in the sample dir ( lineprocessor.cc ). Glad to see I'm on the right track. Anyway, as I said, I can use v8Wrapper class in two ways: as a class member ( multiple instances ) or in a singleton ( single instance mutex protected ). In term of v8 design logic which one do you think is better ? I have some delays ( due to mutex locking ) in "singeton mode" :) but this tells me nothing about v8 performance issues.
Thx, On Feb 23, 7:35 pm, Matthias Ernst <[email protected]> wrote: > Please take a look at the threading constraints in > V8:http://code.google.com/p/v8/source/browse/trunk/include/v8.h#2717 > > > > On Tue, Feb 23, 2010 at 2:08 PM, daniel <[email protected]> wrote: > > Hi, > > > I have the following setup. A base class v8Wrapper which has all v8 > > functions needed to load and run js scripts. A thread having a private > > member object based upon v8Wrapper class. If I create just one thread > > and use v8Wrapper functions everything is ok. If a secondary thread is > > created I get the following error: > > > # > > # Fatal error in src/objects-inl.h, line 1572 > > # CHECK(object->IsJSObject()) failed > > # > > > ==== Stack trace ============================================ > > > Security context: 0x7f0f88a2e721 <JS Object>#0# > > 1: /* anonymous */(this=0x7f0f88a2f141 <JS Object>#1#) > > > ==== Details ================================================ > > > [1]: /* anonymous */(this=0x7f0f88a2f141 <JS Object>#1#) { > > // stack-allocated locals > > var .result = 0x7f0f889ca151 <undefined> > > // expression stack (top to bottom) > > [01] : 0 > > --------- s o u r c e c o d e --------- > > ???????????????????????????????????????????const > > $Object=global.Object;?const $Array=global.Array;?const > > $String=global.String;?const $Number=global.Number;?const > > $Function=global.Function;?const $Boolean=global.Boolean;?const > > $NaN=0/0;????function EQUALS(a){? > > if((typeof(this)==='string')&&(typeof(a)... > > > ----------------------------------------- > > } > > > ==== Key ============================================ > > > #0# 0x7f0f88a2e721: 0x7f0f88a2e721 <JS Object> > > #1# 0x7f0f88a2f141: 0x7f0f88a2f141 <JS Object> > > ===================== > > > Aborted > > > I've done a second test: a instance of a singleton class used in > > threads ( so ... a single instance of v8Wrapper class ). Same result : > > (. > > > So ... what am I missing here ? It's something related to multi- > > threading ? v8 version is 2.1.1. > > > thx, > > > -- > > v8-users mailing list > > [email protected] > >http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
