Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2311 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 17:28:36 »

According to a Google engineer it's not.

[rul=]Writing Java Multithreaded Servers - whats old is new [/url]

Any thoughts.

Offline Riven

« JGO Overlord »

Medals: 1340
Projects: 4
Exp: 16 years

Hand over your head.

« Reply #1 - Posted 2010-05-10 20: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 Wizard

Medals: 143
Exp: 18 years

Computers can do that?

« Reply #2 - Posted 2010-05-10 20: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: 57
Projects: 11

Monkey for a head

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

I've encountered some very strong misperceptions

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.

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline princec

« JGO Spiffy Duke »

Medals: 1033
Projects: 3
Exp: 20 years

Eh? Who? What? ... Me?

« Reply #4 - Posted 2010-05-11 11: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  

EgonOlsen (61 views)
2018-06-10 19:43:48

EgonOlsen (42 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (241 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!