Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Multithreading, Concurrency package and Best Practices - Beginning Java 7 book

 
Teena Ashar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
In what depth are the below topics covered as part of Beginning Java 7 book:

1. MultiThreading
2. java.util.concurrent package
3. Common Best practices in Java

Will be great if comprehensive examples are covered especially in regards to Multithreading.

Regards,
Teena
 
Jeffrey Friesen
Author
Ranch Hand
Posts: 67
5
Android Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Teena,

Chapter 4 provides a thorough introduction to multithreading. You learn about the Runnable interface and the Thread class, thread synchronization and volatile, and thread-local variables. I discuss deadlock, the producer-consumer classic example of thread communication (which involves the use of Object's wait() and notify() methods), Thread.uncaughtExceptionHandler, and more. I pull out certain items to be careful about, such as Thread's setPriority() method impacting an application's portability across different platforms. I also point out some nice-to-know items such as Thread's holdsLock() static method being handy in assertion statements.

Chapter 6 explores the java.util.concurrent package in terms of executors (Executor, ExecutorService, Future, Callable, and more), Synchronizers (I identify this package's various synchronizer classes and show how to use a countdown latch to trigger a coordinated start), concurrency collections (I demonstrate using BlockingQueue to implement producer/consumer), locks (I expand the BlockingQueue example of producer/consumer to also work with reentrant locks), and atomic variables. Furthermore, I introduce Java 7's ThreadLocalRandom class and the fork/join framework with a matrix multiplication example.

I occasionally mention best practices such as lazy initialization.

All the best.

Jeff

 
Teena Ashar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Jeff,
Thank you for the response and appreciate the coverage, this will indeed be an useful stuff.

Regards,
Teena
 
Anandnld Java
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Teena,
Multi Threading is one of the favorite topic and its give more performance to your code. Also when we use it wrong way it gives impact on the output. So one who uses Thread need to know about there need and implementation fully. You can get complete Thread create example here - www.javadiscover.blogspot.in/search/label/Threads

Thanks
Anand

Teena Ashar wrote:Hello Jeff,
Thank you for the response and appreciate the coverage, this will indeed be an useful stuff.

Regards,
Teena
 
Teena Ashar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Anand,
I second you, truly an area where right balance is essential in terms of usage and hence was keen to look forward for examples.
Thank you for sharing the link.

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