Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6751793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:58:08+00:00 2026-05-26T12:58:08+00:00

I’ve been a Java developer for many years but never had to deal too

  • 0

I’ve been a Java developer for many years but never had to deal too much with concurrency issues until I started doing Android development, and suddenly started finding “application not responding” and apparent deadlock situations.

This made me realize how hard it can be to understand and to debug some of these concurrency issues. How do new languages such as Scala and Go improve concurrency? How are they more understandable and how do they prevent concurrency bugs? Can someone provide real-world examples that demonstrates the advantages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:58:08+00:00Added an answer on May 26, 2026 at 12:58 pm

    The three main contenders for simplifying concurrency are actors, software transactional memory (STM), and automatic parallelization. Scala has implementations of all three.

    Actors

    Actors find their most notable implementation in the language Erlang, which as far as I know is where the idea started*. Erlang is designed from the ground up around actors. The idea is that actors themselves are black boxes to each other; they interact only by passing messages.

    Scala has an implementation of actors in its library, and variants are available in external libraries. In the main library, the black-box-ness is not enforced, but there are easy-to-use methods for passing messages, and Scala makes it easy to create immutable messages (so you don’t have to worry that you send a message with some content, and then change the content at some random time).

    The advantage of actors is that you don’t have to worry about complex shared state, which really simplifies the reasoning involved. Also, you can decompose the problem into smaller pieces than threads and let the actor library figure out how to bundle actors into the appropriate number of threads.

    The downside is that if you are trying to do something complex, you have a lot of logic to deal with for sending messages, handling errors, and so on, before you know it succeeds.

    Software Transactional Memory

    STM is based on the idea that the most important concurrent operation is to grab some shared state, fiddle with it, and write it back. So it provides a means of doing this; however, if it encounters some problem–which it typically delays detecting until the very end, at which point it checks to make sure the writes all went correctly–it rolls back the changes and returns a failure (or tries again).

    This is both high-performance (in situations with only moderate contention, since usually everything goes just fine) and robust to most sorts of locking errors, since the STM system can detect problems (and even potentially do things like take access away from a lower-priority request and give it to a higher-priority one).

    Unlike actors, it’s easier to attempt complex things, as long as you can handle failure. However, you also have to reason correctly about the underlying state; STM prevents rare unintentional deadlocks via failing and retrying, but if you’ve simply made a logic error and a certain set of steps cannot complete, STM cannot allow it to.

    Scala has a STM library that is not part of the standard library but is being considered for inclusion. Clojure and Haskell both have well-developed STM libraries.

    Automatic Parallelization

    Automatic parallelization takes the view that you don’t want to think about concurrency; you just want stuff to happen fast. So if you have some sort of parallel operation–applying some complex operation to a collection of items, one at a time, and producing some other collection as a result, for instance–you should have routines that automatically do this in parallel. Scala’s collections can be used in this way (there is a .par method that converts a conventional serial collection into its parallel analog). Many other languages have similar features (Clojure, Matlab, etc.).


    Edit: Actually, the Actor model was described back in 1973 and was probably motivated by earlier work in Simula 67 (using coroutines instead of concurrency); in 1978 came the related Communicating Sequential Processes. So Erlang’s capabilities were not unique at the time, but the language was uniquely effective at deploying the actor model.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I want to construct a data frame in an Rcpp function, but when I
I have thousands of HTML files to process using Groovy/Java and I need to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.