-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mike Sent: 28. juli 2010 05:53 To: v8-users Subject: [v8-users] Re: V8 Multi-Threaded
Jan, Thanks for the reply. I need more clarification on a few things. > You can run the over + you can add more code you compile in later etc. It's > quite capable once you get under the hood, but I will not brag about their > API, doc or samples - that has "room for improvements" :D I still need to know if the compiled scripts are per instance or compile once and use on all instances. The later would be the best of course. I think you can do both. All context are separate, but you can create a context from a template - I have not tried the template thing. And to be honest V8 speed is fast even with compile. My situation is also that I am on a telecom engine who get fed pages from a WebServer in pages - xml that render into JavaScript - so I only get part of the script at time. We use thread pools and context pools now (with spidermonkey). Each request that comes in over the socket is assigned a suspended thread out of the pool that is them resumed to process the request. Basically the same choices I have made. If the request has the proper cookie then its also granted access to the "session global" if a session has been started on a previous request. I like your idea of adding another process too for better core utilization. That is something WIN32 at least appears to lack. Yes - Windows need processes for this. But, also - as I am running scripts written by clients - if something crash it will only be the calls on that process that crash - not the entire server. And you can scale dynamically by allowing the watchdog to add more processes or maybe even add processes on a different box if you use sockets as IPC. Another question. What do you do with the instance after you are done with it. Once the call completes I release the V8 Context and set it's state to recycle - and a maintenance thread will pick it up and clean it. This is V8's Achilles A full, proper recycle take to much time. But, I found some code that recycle by deleting all variables - which is very fast - but this will be subject to further testing. I'm assuming I'll need a pool them and also need a way of suspending them or maybe giving each thread on instance and suspending the thread. Maybe - I actually did this. But, if the fast recycle work as it seems to do when I would not need to. But, again - this part is very experimental as we speak and need more testing. I know the devil is in the details...so please don't spare them. The main thing is that performance is not only about how fast V8 is. In my case performance is how many calls (sessions) can I run in parallel - memory tend to be the only limitation now - which is nice. I can live with 75kb per session as a limitation/cost. My project is open source so I will upload it soon - need to clean up first :-) Jan -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
