Weitere ähnliche Inhalte
Ähnlich wie Concurrency: how to shoot yourself in both feet. Simultaneously. (20)
Mehr von Victor Haydin (12)
Kürzlich hochgeladen (20)
Concurrency: how to shoot yourself in both feet. Simultaneously.
- 1. Concurrency
How to shoot yourself in both feet.
Simultaneously.
Victor Haydin
R&D Manager @ ELEKS
- 14. Web 2.0 – 2003
First dual-core CPU – 2005
Cloud Computing - 2006
- 19. atomic {
if (from.Ballance < amount)
throw new InsufficientBalanceException("Not enough money");
from.Debit(amount);
to.Credit(amount);
}
- 20. Atomic.Do(() => {
if (from.Ballance < amount)
throw new InsufficientBalanceException("Not enough money");
from.Debit(amount);
to.Credit(amount);
});
- 23. Immutable data means no side
effects. No side effects – no
concurrency problems!*
* except if you need I/O