• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Some doubt abt NIO usage ?  RSS feed

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends ,
Back here with some doubts again .. well i want to know what is the significance of non blocking sockets in the new java io package or rarther NIO ??
Can anyone tell me this ??
Hoping to hear from you soon ,
Thanks,
Saurabh
 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you can do useful processing while waiting for more data to arrive over the network, non-blocking is a hnday way to just grab whatever data is available and continue processing. A more common use is in high-load servers. With blocking IO you need to spawn a new thread for each request which limits the number of simultanious request the server can handle and uses a lot of processor cycles switching back and forth between all the threads.
With non-blocking IO you can handle massive converrency without massive thread creation and you can accomplish useful things during periods of lag from network latency instead of just waiting for packets.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!