Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hi, I have passed my assignment.

 
Jesse Xie Y.S.
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • 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
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Congratulations! Hey 80:80 locking - you are one of the elite!
 
Alan Morgan
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • 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
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11865
194
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Congratulations Jesse
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Davinder Kohli
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
  • 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
Marshal Commander
Pie
Posts: 11865
194
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Sun Certification Results forum.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic