Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Bigwood Liu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The title is my question!
1. After each updata the buffer, or
2. At last before close the server?
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic