Unfortunately multi-threaded programming is probably one of the most complex programming topics. Thus it's really hard to explain in a forum in detail if you're completely unfamiliar with it. Of course as Scala is a general purpose language it's not only about concurrent programming for multi-core computers...
Just out of curiousity, have you really not heard the term "multi-core" before or did you think it was something different meant in this context?
Joined: May 17, 2006
have you really not heard the term "multi-core" before or did you think it was something different meant in this context?
I have heard and know multi-core in processor context. I didnt thought that is what the book refers
Writing correct multithreaded application on a single processor is already hard. With multiple processors and multiple cores, this only gets harder.
On one hand, we have the benefits of multithreading—highly responsive, scalable, performing applications can be developed with multiple threads.
On the other hand, we have to confront the perils of multithreading. The facilities in Java let the threads share mutable state. While this is quite convenient,
it takes a lot of effort to ensure that no two threads end up compromising data integrity though race conditions.
You can't simply run the code and say it "works." It is not unusual to find issues with multithreaded code in "working" applications.
In addition to race conditions, we have to worry about issues that may arise from caching or optimizations. While these are done in good faith,
they do not allow your program to work as intended in a multithreaded situation.
If you have to deal with these at your application code level, much effort and code is spent on these details and that means you are not devoting
as much time, effort, and code for your application logic.
This is what I mean when I say multi-core complexity and Scala addresses this problem at the root. It encourages us to use immutable state and
allows threads to easily communicate using an actor based model.
after reading quite some stories here and from other sources and books about the advantages of Scala regarding multithreaded applications I still have the impression that the technical hurdles for creating clean concurrent code is only part of the solution, although a very important part. I guess, it's the way many or most develpers think about the problem which has to change. My experience is that a lot of people don't even understand the problem and a lot of others don't care about it. What's your opinion on this?
Joined: Jan 28, 2008
Marco, I am quite satisfied when there are reasonable solutions on hand for people who care
It's sad but true Maybe more of those so called developers start to think or are forced to think about the quality and correctness of their code if more problems arise when multi-core machines become even more widespread!