• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

NX: If you use ByteBuffer, when do you store the data into disk?

 
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The title is my question!
1. After each updata the buffer, or
2. At last before close the server?
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Damu,
1. After each updata the buffer
The problem with 2. is that if your server crashes, all your updates will be lost.
Best,
Vlad
 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vlad, thank you for reply.
But it is too frequent for the server to do writing, if there are too many clients. How do you write the buffer to disk? I write the whole buffer to disk as following: I think buffer's advantage of fast operation is damaged if write the whole buffer to disk too often.
I had thought the problem of server crash. But when I rethink it, I was trapped in dilemma.
[ November 07, 2003: Message edited by: damu liu ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic