Comments (1)
Hi Carlos,
Thank you for your post! You are indeed correct that the scenario you describe can happen.
One possible workaround could be to unify isEmpty
and put
into a single method.
However, since this exercise is explicitly designed to demonstrate that busy waiting is detrimental, a single thread was assumed for simplicity.
But, to ask the reader to redesign the SyncVar
API to support multiple producers would be an interesting open-ended question.
from learning-examples.
Related Issues (20)
- Q: `trySuccess` vs `success` HOT 3
- `success` in `timeout` needs a value HOT 1
- Q: timeout & callback HOT 1
- Q: timeout and `or` combinator
- Something wrong in ch9 about ParLongAccumulator HOT 1
- CH3 FileSystem HOT 2
- Example org.learningconcurrency.ch6.ObservablesSubscriptions runs infinitely HOT 2
- Is the CAS implemention demo wrong? HOT 2
- What does 'the last event' mean in Ex4 of Ch6 ? HOT 3
- Unit test for Concurrent Code HOT 13
- Ch8 Actors - CheckActors gives dead letter errors
- Isn't ensime dead?
- Deadlock at page 45: Why `t1` locks `a` and `t2` locks `b`? HOT 1
- [error] sbt.librarymanagement.ResolveException: Error downloading org.ensime:sbt-ensime;sbtVersion=1.0;scalaVersion=2.12:1.11.0 HOT 1
- Possible error on the book? [both editions]
- Sample solutions HOT 5
- deprecated code elements so soon in the book's lifecycle? HOT 3
- CAS example HOT 2
- `AtomicBuffer#+=` needs to be final or private HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learning-examples.