• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[URLyBird]Should LockManager extend Thread?

 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I thinkg I am not good at Thread at present. The LockManager in DB Layer take charge of making present thread waiting for other client unlock and wakeing up all the sleeping thread when present client unlock. I am not sure whether LockManager should extend Thread. If not needed here, then the following form to use wait and notifyAll is correct or incorrect.

 
Ranch Hand
Posts: 284
Netbeans IDE Firefox Browser Debian
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Zhixiong,

I think I am not good at Thread at present


All of us feel more or less 'lost' at the beginning of the asignment. But have this in mind: to become a SCJD you must dominate multithreading. Begin being good at it. You will save time and headache.

I am not sure whether LockManager should extend Thread


Why aren't you sure? Do you want your lockManager instances starting concurrent executions?

If not needed here, then the following form to use wait and notifyAll is correct or incorrect.


I know many people here is not english speaker. Like me and likely like you. But IMHO this is the typical example of how a question must not be posted in a forum
. Or maybe it's not a question, it's a big truth : "the following form is correct or incorrect"


Regards
 
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Isn't lock manager supposed to be a singleton? If it is, it should not extend Thread
 
Zhixiong Pan
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Still unclear about it. In server we can only have one Data instance whcih also contain only one LockManager instance. So LockManager can not be a Thread. Can any one give me some advices? Thanks.
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic