blueklein76 wrote:
Hi there,

I want to write a server-side JavaScript module for APE that will
handle hundreds of users on multiple active channels.  Say I use the
APE server events like this:

Ape.addEvent("beforeJoin", function(user, channel) {
        var uname = user.getProperty('name');
        var cname = channel.getProperty('name').toLowerCase();

        Ape.log("User " + uname + " is joining channel '" + cname + "'");
        // Store the user+channel info and do something
});

Is it possible for the event handler to be called by multiple threads
at the same time?  Or is all the JavaScript code executed by a single
thread (in which case surely this is a bottleneck for all the incoming
HTTP requests)?

Similarly, if I were to use a global variable to share data between
event handlers, do I need any kind of locking mechanism to prevent
different event handlers accessing the same variable at the same time?
if you have a look at the code, you'll see that it's single threaded/single process, so, no problems and no need for locking et al. therefore, also no performance gain on a multi-core server, but otoh, all processing is asynchronous, so at least one core is used to the maximum (and another core will be used for sys).

BR
Stefan

--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to