0
\$\begingroup\$

My game server will have to respond to requests very often, so I consider threading a good option.

But should I use Task class from .NET or have several threads that would execute requests which I would store in a queue (linked list). Which way would be faster?

\$\endgroup\$
1
  • 1
    \$\begingroup\$ The Task class does threading. Its full namespace is System.Threading.Task. It's not clear what your other solution would do differently. \$\endgroup\$ Commented Apr 26, 2015 at 7:29

1 Answer 1

1
\$\begingroup\$

For client Yes. For server not advisable. Loads can be distributed by putting it on queues and let individual servers handle the load. You also have an option to limit the load by assigning what type of task should a server handles. Accounts Server, Game process, Chat etc.

You use thread mainly on client mostly for the purpose of multi-functionality of your games.

Task is a Threading class available in C#. I'm not sure how you differentiate them.

\$\endgroup\$
1
  • \$\begingroup\$ I already split the server into account/chat/game servers. I'm asking for cases of those individual servers. When they accept a request, should I use a Task or several Threads to handle the response, considering I might need to use file system, which is slow? \$\endgroup\$
    – zoran404
    Commented May 1, 2015 at 16:35

Not the answer you're looking for? Browse other questions tagged .