1/28/19: What is multithreaded, asynchronous and what does this matter?

Liam Bolling
Ellie Calendar
Published in
2 min readJan 28, 2019
This week I’m going to dive a little into the multithreaded issues I’ve been running into.

Before jumping into my weekly update on Ellie Calendar, let’s recap on the basics of a computer.

A computer is essentially the equivalent of a massive calculator, and in the early days it did one calculation at a time. This quickly became an issue because in a world with series computing, moving your mouse while checking for new email wouldn’t be possible. Hard to imagine but bare with me.

The next step for computing was to create a method of doing multiple things at once and this started with threading. This allows processes to queue up mini-tasks for the computer to complete in parallel and essentially share compute power. These mini-tasks live in threads and the process I’m describing is surprisingly called multithreaded processing.

So now you see the incredible advantage multithreaded processing presents to software and it one of the core reasons why the apps in your phone and computer are responsive. The downside of this is that it makes building software a bit more complicated, especially when it comes to data storage.

Here’s the abstracted version of the issue I was running into with Ellie Calendar.

A quick diagram of Mary and Jimmy helping John figure out free time.

Meet John.

John is assigned to managing your calendar. He tasks his freinds Mary and Jimmy to go off and find free time during the next two days for you. Mary takes your calendar and returns with the calculation, then Jimmy almost does the same. Right before Jimmy gives his information back to John, he’s told it’s no longer valid because Jimmy pulled old data since Mary’s update came in quicker. Bummer.

Crash.

Now you see how this gets complicated and with a ton of refactoring in Realm, I’ve designed better processes that don’t run into that issue. In that scenario, Mary and Jimmy are only given data that they need and if they need to write anything to the central calendar (also known as John in this case) it does that write in series.

The summary of this rant is that there are advantages to both methods of computation and I think I’ve figured out how to get them to live in peace with each other so the user has great scrolling performance while keeping all computing on the device (and not in the cloud).

Maybe next week I’ll go into why keeping things on the device is important.

Weekly Updates: This is part of my weekly updates on making a modern calendar called Ellie. It might include super technical stuff, product decisions or design challenges.

--

--

Liam Bolling
Ellie Calendar

Liam Bolling is a Product Manager and startup founder with a background in tech companies such as Google and Microsoft. See more at https://www.liambolling.com