English 中文(简体)
Can someone explain this article about enforcing race safety in Scala
原标题:
问题回答

Enforcing race safety without giving up on mutable objects, would be a best wording of it.

The problem is simple. Let s imagine you have a mutable map M, and actors A1 and A2. Actor A1 sends a message to actor A2 containing M. The question is, are you running any risks?

The idea of the paper, if I understood it correctly, is to improve the type system so that you can guarantee that A1 will not reuse M after it was sent to A2. You use a mutable data structure, but you ensure, through the type system, that it can only be accessed at one point of the code at a time.





相关问题
Get first unlocked row in MYSQL

When someone visits my website, he will see the page with the fewest pageviews. All pages, including a pageview counter, are stored in a MYSQL database. If a page is viewed, the pageview counter is ...

Simulating race conditions in RSpec unit tests

We have an asynchronous task that performs a potentially long-running calculation for an object. The result is then cached on the object. To prevent multiple tasks from repeating the same work, we ...

Python Service File Caching Apache Race Condition

I am writing a python service (pyamf) through which a user can access images. All images are stored on a central server. The python services will be running on satellite machines which have network ...

Javascript threading race condition

EDIT: I figured out the answer to the original YUI3 question I posted here, but it led to another one and instead of starting a new thread I thought I d just add it here. Please scroll down for the ...

Race between virtual function and pthread_create

When I try to create a class instance with a virtual method and pass it to pthread_create, I get a race condition, causing the caller to sometimes call the base method instead of the derived method ...

Nhibernate, multithreading, and race condition

I am having a problem with a race condition when saving to the database asynchronously using NHibernate. First an insert to the database is done asynchronously where the unique id is auto-generated. ...

热门标签