Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Implementing Lock interface  RSS feed

 
Toni Lane
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are there any good examples on implementing the Lock interface?
 
Campbell Ritchie
Sheriff
Posts: 55334
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want to implement the interface youirself?

Question too difficult for “beginning”; this question would fit better in our Threading forum.
 
Toni Lane
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Why would you want to implement the interface youirself?

Question too difficult for “beginning”; this question would fit better in our Threading forum.

Well, I was learning concurrency and i thought that I shouldn't skip java Locks until i have successfully implemented my own CustomLock.
I didn't know that beginners aren't expected to know that.


however, should this thread be moved? or do i make a new thread? or should i just skip this to the next concurrency topic (as a beginner)?
 
Henry Wong
author
Sheriff
Posts: 23275
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Toni Lane wrote:Are there any good examples on implementing the Lock interface?


Well, on one hand, the core Java library is provided as source code. So, if you are interested in how the library implements the built in lock classes, then you can actually see the source code. On the other hand, the library implements the locks optimistically, which can be very complex. I am not sure if beginners can gain much by trying to use them as examples.

Regardless, it can't hurt to take a look.

Toni Lane wrote:
however, should this thread be moved? or do i make a new thread? or should i just skip this to the next concurrency topic (as a beginner)?


It looks like Campbell already moved this topic to the threads forum for you.

Henry
 
Toni Lane
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the responses. I think i will leave it for later then.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!