maximal user thread count.

Post here your suggestions for new possible features in SmartFoxServer 2X.

Moderators: Lapo, Bax

Neznajka
Posts: 10
Joined: 14 Jun 2012, 09:12

maximal user thread count.

Postby Neznajka » 11 Sep 2013, 10:29

maybe there is already that option but I woul like to know how to set it next I will explain what I wan't to see.

NOW - user got internet lost, packets are collecting to user cache after internet going online all packets are send to server, after all packets have came to server, in order they come they start executing in paralel threads, I mean you have 50 messages and 50 threads, ater Smartfoxserver launches 50 threads for same user for same room for same extension for same function, why this is problem beacuse some times eaven, if (boolean == false) { boolean = true ...} starts executing same function beacuse thread 1 and thread 5 have allmoust same income objects and in the same time reaches if (boolean == false) then both threads goes in and happens bad things.

would be nice - you have number maybe in my case I would set it to 1 and when incomes 50 packets and have 50 threads it takes the setet number of threads, makes them busy and then 1 by 1 start executing income packets I mean, incomed packet 1 after it is done income packet 2, and so on while there would be no packets. something like tcp protocols where incoming packets comes to server in order they was sent not the random threading where thread with packet 10 can be faster than thread with packet 1 and could happen something bad. you may eaven just delay a bit, packet execution if user have already one. till that packet execution is done.
User avatar
Lapo
Site Admin
Posts: 19675
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: maximal user thread count.

Postby Lapo » 18 Sep 2013, 08:12

I found it hard to follow your description, sorry.
It seems you are assuming that for every packet an equal number of threads is created, but this is really not the case. SFS2X uses a fixed ( and configurable ) number of threads to handle tens of thousands of messages from each User. Even 4 threads are already sufficient to handle tons of messages.

You can learn more here:
http://docs2x.smartfoxserver.com/Advanc ... extensions
Lapo
--
gotoAndPlay()
...addicted to flash games
Neznajka
Posts: 10
Joined: 14 Jun 2012, 09:12

Re: maximal user thread count.

Postby Neznajka » 20 Sep 2013, 08:02

No problem was not in thread system that you have, but there is an solution to this by using synchronize locks. to force 1 thread for 1 user or at least it gives oportunity to force drop same income packet. or the same request,user if you can't be sure that function will work correctly, if same user calls it in same time period.
User avatar
Lapo
Site Admin
Posts: 19675
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: maximal user thread count.

Postby Lapo » 20 Sep 2013, 08:38

Locking on each User request is not a good idea, this way you will make the server essentially mono-threaded.
But I probably don't understand what you are talking about specifically.
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “2X Features Wish List”

Who is online

Users browsing this forum: No registered users and 2 guests