Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Blocking queues  RSS feed

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"It is much easier and safer to use higher level structures that have been implemented by concurrency experts"

Source: Core Java Vol. 1 (8th Ed) P.764.

Would you agree with the above statement? Why?
 
Henry Wong
author
Sheriff
Posts: 22847
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, the book is saying -- have your threads use a thread-safe collection to pass data around. This is easier than passing the data around in a non-thread-safe collection where you have to deal with thread safety yourself.

In other words, your options are "don't deal with thread safety" or "deal with thread safety". Isn't doing nothing easier than doing something?

Henry
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!