HappyDeveloper
HappyDeveloper

Reputation: 12805

Alternative to "one thread per X" architecture?

I have been told that I shouldn't be using "one thread per" anything aproach if I want my application to scale beyond "not so far", and that there were other architectures I should look into. Only I weren't told any of those architectures' names, and I couldn't find much on google.

Specifically I need this for a real-time web game, mostly chat-based. I would be using web sockets, but I need to process all the incoming events (many per second per game) concurrently fast enough.

If possible, I need this architecture to be viable in Ruby or PHP.

Any ideas?

Upvotes: 0

Views: 126

Answers (1)

Olof Forshell
Olof Forshell

Reputation: 3274

I am not familiar with the APIs available to Ruby or php. If they can access the Win API and can be multi-threaded the recommended Windows functionality is that of IOCPs (I/O Completion Ports) that are connected to handles and sockets. One thread per available core usually works best to maximize scaling.

Upvotes: 1

Related Questions