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

NX: Multiple Threads perform updates

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just suddenly think of a question.
For the network mode, if there are 2 users on 2 different machines, connects to the same server, and perform the update task, what should I do?
According to the instructions in the assignment, this case is not mention.
Still, I think only 1 user (FCFS-based) should update the record, and the other requests are rejected. But, how should I handle this case?
Get a lock on item X, check before update, if it is already non-empty, then
throws an AlreadyBookedException?
Thanks a lot.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nicholas,
I think you are on the right track here.
What exception you throw, or how you handle that case, depends in part on what your signature for the update() method is.
Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic