paint-brush
Executing Heavy Tasks Without Blocking the Main Thread on Flutterby@altynberg
6,204 reads
6,204 reads

Executing Heavy Tasks Without Blocking the Main Thread on Flutter

by Altynbek Usenbekov2mDecember 15th, 2020
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

On Flutter everything runs on a single (main) isolate and executes only one operation at a time. This means while your app is doing strenuous work, you will lose the interaction and the UI will freeze. We can create new isolates and do the heavy work there, but every isolate can reach only its own memory, and if you have to use a large set of data it won't be very optimal because we have to copy the large data from one isolate to another, and it can still block the main isolate while doing that. Every situation requires a different approach but in most cases we can solve them on the main isolate using an event queue optimally. Let me show you one of these approaches.

Company Mentioned

Mention Thumbnail
featured image - Executing Heavy Tasks Without Blocking the Main Thread on Flutter
Altynbek Usenbekov HackerNoon profile picture
Altynbek Usenbekov

Altynbek Usenbekov

@altynberg

Software Engineer

About @altynberg
LEARN MORE ABOUT @ALTYNBERG'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Altynbek Usenbekov HackerNoon profile picture
Altynbek Usenbekov@altynberg
Software Engineer

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite