¡Sorpréndeme!

Software Transactional Memory - A guide to NOT have deadlocks and NOT have race conditions!

2025-04-14 2 Dailymotion

Wondered why transactions can carry with them deadlocks and race conditions? Then this video maybe is for you. We are not going to discuss exactly how deadlocks and race conditions occur. Instead we are talking about a way to avoid them completely using Project Arrow's STM. Make sure to follow this video until the end to learn interesting aspects of it and how transactions work in this way. I hope you enjoy the video and I hope you find it useful for your every day transactional endeavors. As usual, until the next video, be sure to stay tech, keep programming, be kind and have a good one everyone!

PS: Given the intense scheduling of the channel and the amount of work, the Wednesdays sessions, under the pilot project, have moved to Thursdays 8PM CET. The reason for this is to see if that scheduling reaches more people given generic availability to watch premieres a on this day.

---

Chapters:

00:00:00 Start
00:00:36 Intro
00:00:39 Software Transactional Memory (STM)
00:02:04 Explaining Software Transactional Memory in Project Arrow
00:02:24 Talking about "Architectural Support for lock-free data-structures"
00:02:58 Back to STM
00:04:23 Another run through "Architectural Support for lock-free data-structures"
00:04:42 Explaining Transaction cases
00:07:55 Optimistic Concurrency Control
00:08:31 Introduction to the example
00:08:44 Talking about the "8 reasons why you should... or should not choose Ktor from a Spring Comparison Perspective"
- https://www.youtube.com/watch?v=S3k6C1XaYr8
00:13:14 Talking about the "8 reasons why you should... or should not choose Ktor from a Spring Comparison Perspective"
- https://www.youtube.com/watch?v=S3k6C1XaYr8
00:14:47 Explaining the requestDocking method - Simple Common Transaction
00:17:32 Talking about past 5 coroutine videos:
- https://youtu.be/LyAOF37cJ-c
- https://youtu.be/DYTbVcGZbH8
- https://youtu.be/lir1-2dpAzA
- https://youtu.be/SstFGOcu3ls
- https://youtu.be/0MJartdpoT4
00:20:24 Explaining the refuel method - Simple Common Transaction Highlighting Conflict
00:23:37 Talking about the Dispatcher.IO quiz video: "Unleashing Kotlin's Potential: Dispatching 100 Coroutines Made Easy"
- https://www.youtube.com/watch?v=7UB7zE3E-f0
00:24:13 Explaining the refuelWithRollback method - Simple Common Transaction with rollback on error
00:32:22 End Notes
00:34:51 See you in the next video!
00:35:39 End Credits
00:36:20 Disclaimer

---

Source code:

- https://github.com/jesperancinha/space-ship-adventures

---

Soundtrack:

- https://soundcloud.com/joaoesperancinha/slow-guitar-13-jesprotech

---

References:

- https://ktor.io/docs/welcome.html
- https://arrow-kt.io/learn/coroutines/stm/
- https://www.microsoft.com/en-us/research/wp-content/uploads/2005/01/2005-ppopp-composable.pdf
- https://dl.acm.org/doi/pdf/10.1145/2976002.2976020
- https://cs.brown.edu/~mph/HerlihyM93/herlihy93transactional.pdf