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

Giving the Data Server's shutdown process priority over client's

 
dean tomlinson
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
having followed many of the suggestions from others on this forum, i have implemented a gui for my dat server, that enables the data server to be shutdown.
and that shutdown process basically calls lock(-1) and when this completes, the server can be sure that no clients have begun to modify the database, the database is safely closed
what i want to do is give the server's thread priority over the client threads that may be competing to lock out records.
i have set the server threads priority to maximum, and i have read that this will only have aneffetc on certain operating systems, but assuming my operating does, will this mean that if the dataserver's thread and a client's thread are both waiting to enter the syncd lock method, the notifyAll call will wake up the server's thread ?
in the books i've got that cover thread scheduling, it doesn't mention that the notifyAll call wakes up the thread with the highest priority (on an os that supports preemtive scheduling).
if it doesn't, what does the threads priority affect ?
cheers - dean
 
BJ Grau
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't even considered a GUI for the server because I didn't see it in the requirements. Is this necessary?
What are the arguments for and against doing this?
[ June 05, 2002: Message edited by: BJ Grau ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For server GUI. Doesn't need to be complicated. Simple is best. Gives the server administrator an easy way to shutdown the server, without having to also stop the RMIRegistry.
Can give the server administrator status messages as to what is happening on the server, when a request is sent, when it is up, blah blah blah. And also allows you to display error messages in JOptionPanes when there is a problem, that doesn't concern the clients.
Now as far as thread priority. You cannot guarantee which thread will still get the lock, you are incresing the odds that the server would, but not 100%. I don't think you should worry too much about changing thread priorities. The server will close eventually, and no clients will be harmed.
Hope that helps
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic