January 2019
Intermediate to advanced
520 pages
14h 32m
English
Let's say you know which class the task belongs to, either I/O or CPU. IO tasks can be handled in a single thread, because they have to wait for a lot of I/O data. If your hardware has multicore CPUs and a lot of I/O devices, however, a single thread isn't enough. You may decide to use multiple threads with a single asynchronous context, but there's a problem—not every asynchronous task can be transferred between threads. For example, SQLite-embedded databases stores service data in thread-local storage, and you can't use the same database handle with multiple threads.
SQLite can't work with databases asynchronously; it has asynchronous methods that interact with instances that run in a separate ...
Read now
Unlock full access