Subj : Re: Threading question - (50 bucs if you help me) To : Nick Longinow From : Brendan Eich Date : Fri Feb 14 2003 04:27 pm Nick Longinow wrote: >Just kidding on the 50 Ohio State Univ. players thing. >Did it get you to read this ? Please help!! > >I have a single service that creates the JS engine, and >then each user request that hits it creates its own >runtime and context. I find that this works fine except >for threads that hit at the roughly same time. > >Specifically, I AddRoot several items right after the >context is created for a new thread, and shortly after >do a MaybeGC. So far so good, as long as the threads >hit far enough apart. > >But if they occur close enough together, then the >gc_root_marker check will find that at least one of >those items I did AddRoot on fail the check for >root_points_to_gcArenaPool = JS_TRUE; > That means the GC scanned a root you registed by its address and found it contained a pointer (jsval or plain pointer) that did not point within the GC heap. You either failed to initialize the root, or you let it turn into garbage on the malloc heap (get recycled, and filled in with new bits that did not form a valid GC-thing pointer) without first unregistering the root with JS_RemoveRoot. /be > >The 1.5 jsgc.c code has a comment that says this is due to >some root not being removed properly. But, I am still >using those objects, and so wouldn't *want* to do a >remove root on them. > >Any ideas what the collision here is all about ? > > .