Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Is NIO all its cracked up to be?  (Read 1433 times)
0 Members and 1 Guest are viewing this topic.
Offline CaptainJester

JGO Knight


Medals: 12
Projects: 2
Exp: 14 years


Make it work; make it better.


« Posted 2010-05-10 19:28:36 »

According to a Google engineer it's not.

[rul=http://paultyma.blogspot.com/2008/03/writing-java-multithreaded-servers.html]Writing Java Multithreaded Servers - whats old is new [/url]

Any thoughts.

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 742
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2010-05-10 22:20:54 »

Surely NIO has its downsides:
- own code complexity
- slightly less performance than recent threading models
- horribly designed java.nio API

One upside remains:
- few threads

Every thread requires ~1MB of RAM. With thousands of connections that is a problem, unless you want to add >8GB of RAM to your system, *only* for handling your threads. For true multiplexing (not request=>response) you actually need 2 threads per connection, making the memory problem even worse.




Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline delt0r

JGO Knight


Medals: 26
Exp: 18 years


Computers can do that?


« Reply #2 - Posted 2010-05-10 22:34:30 »

Linux NPTL is not avalible everywhere. When non blocking nio was released, these type of thread developments where clear. Its not the solution to every problem.  Now that we all have multi core machines, its it any surprise that multi threaded can do well?

Even better have n threads where each handles m connections. Where n & m can be tuned. 

However in my game i get big gains with simplicity of debugging and mutex management by having a single network thread. The API follows a fairly popular C api as i understand, and didn't find it hard to use. Also thread synchronization can be quite slow, but mainly because the hotspots can't optimize the crap out sections of code with lots of synchronization code.


I have no special talents. I am only passionately curious.--Albert Einstein
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel


Medals: 56
Projects: 11


Monkey for a head


« Reply #3 - Posted 2010-05-11 11:00:11 »

Quote
I've encountered some very strong misperceptions

Quote
Then ran them for me on his 768core Azul box

Well yes, I imagine quite a few "misconceptions" go right out of the window when you're working on highly specialised hardware with hundreds of cores. For the rest of us who aren't working at google and have to deal with much more run of the mill hardware I don't see how this is really relevant.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Online princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2010-05-11 13:02:43 »

Well, some of the discussion revolves around the relative simplicity of doing things the "old" way (1 thread to 1 client connection).

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (33 views)
2014-07-18 06:55:21

Zero Volt (29 views)
2014-07-17 23:47:54

danieldean (24 views)
2014-07-17 23:41:23

MustardPeter (26 views)
2014-07-16 23:30:00

Cero (41 views)
2014-07-16 00:42:17

Riven (43 views)
2014-07-14 18:02:53

OpenGLShaders (31 views)
2014-07-14 16:23:47

Riven (30 views)
2014-07-14 11:51:35

quew8 (29 views)
2014-07-13 13:57:52

SHC (64 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!