• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

Hi, I have passed my assignment.

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Date Taken: 2005-10-27 06:45:22.437

Grade: P
Score: 362
Comment: This report shows the total number of points awarded for each section. The maximum number of points is 400, to pass you need a score of 320. Section Summary: Section Max Actual Points Points General Con: 100 90 Documentation: 70 65 OOD: 30 30 GUI: 40 27 Locking: 80 80 Data Store: 40 40 Network Server: 40 30 Total: 400 362
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations! Hey 80:80 locking - you are one of the elite!
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats

So what was your locking approach ?
I have seen some really complex ones on here and I'm starting to get worried.
Hopefully its nice and straightforward
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations Jesse
 
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congrats,

I have a small question, I see that you have 80 on lockig.

What look strategy you use ?
 
Jesse Xie Y.S.
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am so happy that I foregot to say thanks to JavaRanch.
Because I've learned so lots from JavaRanch.
---------------------------------------------

My lock implementation is very simple.
1. I uses a static Random long seed initialized once JVM started, as a seed of looked cookie generation.
2. I uses a map to store all current available mapping of locked record and cookie. The key of the entry is a record number, the value mapped to the key (record) is the cookie held by a client.
3. I uses the object locked of the map to synchronize the record lock and unlock process.
4. I notify all thread waiting on the object locked of map only after unlocked a record successfully.
5. Make sure that the process of checking if a record is locked by other thread or checking if the record is exist, before locked a record, should be keep in synchronized block.
 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


How long after you took your essay exam, did you get your results?
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jesse I still have a question. Whar you realy mean by


Make sure that the process of checking if a record is locked by other thread or checking if the record is exist, before locked a record, should be keep in synchronized block.



You mean that the the isLock(int):boolean metohd must be keeped in to a synchronized block - synchronized with the same instance like lock(int) metod ? By lock(int) I mean the menthod that locks a record in the lock manager.

Thanks,
Mihai.
[ October 30, 2005: Message edited by: Mihai Radulescu ]
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moved to the Sun Certification Results forum.

Regards, Andrew
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic