Porting Java's ConcurrentHashMap to Rust (part 1)

Channel:
Subscribers:
97,800
Published on ● Video Link: https://www.youtube.com/watch?v=yQFWmGaFBjk



Duration: 5:42:38
63,296 views
962


In this stream we begin the work of porting Java's ConcurrentHashMap to Rust. It will be a journey to get all the way there, but we got through most of the get, insert, and resize operations. Of particular note is the work required to go from the Java code's reliance on the garbage collector to Rust's runtime-free model. See also the commit for the stream at https://github.com/jonhoo/flurry/commit/50fc36cb4056e68ea96fbf8f214886faf4657a4e.

You can see our progress at https://github.com/jonhoo/flurry. The Java code we were working from is included in that repository, or you can view it at https://hg.openjdk.java.net/jdk/jdk13/file/0368f3a073a9/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java.

You can watch the live version with comments at https://youtu.be/hUi6HyVOAKM

0:00:00 Introduction
0:10:57 Reading Java's ConcurrentHashMap documentation
0:51:17 Copying documentation and constants
1:01:09 Starting node
1:11:07 Writing BinEntry::find
1:31:47 Creating the library outline
1:45:17 Writing get
2:11:47 Writing put and insert
3:13:43 Transfer and resize
4:46:35 Porting Java triple bit-shift
4:52:16 More resizizing
5:26:14 Questions and conclusion







Tags:
rust
live-coding
java
concurrency
port