I have some questions regarding Multithreading:
I have some code like this:
Code: Select all
public class ScriptHandler extends BaseClientRequestHandler
{
@Override
public void handleClientRequest(User user, ISFSObject params)
{
String test = params.getUtfString("test");
...
...
(Many, many, many instructions)
}
}
or
Code: Select all
public class ScriptHandler extends BaseServerEventHandler
{
@Override
public void handleServerEvent(ISFSEvent event) throws SFSException
{
User user = (User) event.getParameter(SFSEventParam.USER);
...
...
(Many, many, many instructions)
}
}
If multiple requests arrive at the same time, how does SmartFox manage them?
Are the variables assigned at the beginning of the code overwritten even if the Tread has not finished all the instructions?
Or wait for the Tread to finish the instructions before overwriting the initial variables?
Greetings