May 28, 2007

Ask an FMS Guru #22: Does each NetConnection execute the server side script in it's own thread?

Have to apologize on the delay for this question here, I've been overwhelmed this past little bit with all kinds of work.

The question: Does each NetConnection execute the server side script in it's own thread?

The answer:

Each NetConnection does not have it's own thread, but it does stand in line in one thread that lives on the server side.

For some reason, and this has it's own pros and cons, FMS still only works on one thread on the server side per application. So, if you start up an application then a thread gets created and within that thread everything runs in the order that it is received.

This can be good in ways because you can control the order in which something will execute, but at the same time it's limiting in what you can do because you have to wait for a loop to end first or something.

So, this question actually has an explanation with it and that is that this particular person is having trouble dealing with lots of users logging into the application and making remoting calls to a DB.

Sometimes in an application you may have a lot of people do the same thing at once. Logging in is a good example. In the case where you have to do something before actually letting them do something else like accepting their connection, you can put the client in a queue. Meaning that they get placed in a lineup to wait for a return object, like from a remoting call, before they can move foward with whatever they will be doing.

So, the deal with this person is that sometimes calls would made at weird times, like there is a huge delay. At least as far as can be seen using a trace statement.

Unfortunately with FMS this can happen, but more importantly the trace may also just be delayed. I've had some tough times telling which it is.

Without looking at the code it's really hard to say what the problem could be, and the best I may be able to do is just point out that some people have noticed FMS is a bit buggy concerning making remoting calls. Sometimes it's delayed and sometimes it doesn't do anything at all. In these cases, it's best to make sure Adobe knows that you think there is a bug because they really want to know what it may be and actually fix it.

Adobe's bug reporting page is here.

Posted by Graeme at May 28, 2007 01:08 PM
 



Comments