Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

worker threads and file updates

 
Stephen Anson
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I'm just designing my update code from the Record cache, for example a client 'books a room'
There seems to be several ways to go about this options which I'm considering are:
1. update the file first if this is successful update the cache (seems simplest to me, but may leave user hanging around.)
2. pass off file update to a worker thread, update cache, fast response time but what to do if there is an exception in FileIO, how would this be reported back to the client.
3. Run a background thread that regularly keeps the file up to date with the record cache.

I'm just wondering what others are doing/think about this situation.

cheers Steve :-)
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally I think caching is just extra that isn't necessary to get a perfect score on this assignment. Remember this assignment is supposed to be simple, and test in specific areas (Swing, RMI, etc), caching NOT being one of those areas.

Just to keep in mind, but I won't stop you from Caching.

Mark
 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing #1. Performance is not a issue realy, besides the hang time is not too bad. I chose cacheing not for the performance advantage but because it is so much easier to code and IMHO provides a much more cleaner sollution (lazyness on my part realy).

#2 and #3 seems to make things too complicated. Besides I dont think your getting that much of a perofrmance advantage... and I think sychrnization among all the operations and handling all the exception is going to be PITA.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic