This week's book giveaway is in the
We're giving away four copies of a choice of
"Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac"
and have Joe Kissell on-line!
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Take Control of Upgrading to Yosemite
Take Control of Automating Your Mac
this week in the
Developer Certification (SCJD/OCMJD)
B&S: until the desired resource becomes available...
Joined: Sep 04, 2008
Sep 05, 2008 05:22:00
Bodgitt and Scarper 2.1.1
"Any attempt to lock a resource that is already locked should cause the current thread to give up the CPU, consuming no CPU cycles until the desired resource becomes available."
I felt it was really bad to do this to a GUI user so my locking solution puts uses a lock request with a timeout. This puts the lock in a TIMED_WAIT rather than a WAIT state.
I'm pretty sure that consumes no CPU cycles but its not really blocking until the resource is available.
And of course now I'm about to submit and I'm in a flap about this.
Its says "should" rather than "must" which helps.
Does anyone have any good/bad experiences submitting this sort of approach?
subject: B&S: until the desired resource becomes available...
Locking, about sentence: "consuming no CPU cycles"
My Locking Approach
Blocks synchronized, but without wait() or notifyAll() methods.
My Locking Method: please, advise me.
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014