diff options
author | Tim Culverhouse <tim@timculverhouse.com> | 2022-09-27 22:43:53 -0500 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-04 09:18:30 +0200 |
commit | 4c371170c57d39399a924bd4d27d67226a9a7f39 (patch) | |
tree | 8b08b9cfc1b8406656d005d2761ae56df961a130 /lib/sort | |
parent | 1c2dd4c9f15ddc9cba0849c4077525bd6d64cd6a (diff) | |
download | aerc-4c371170c57d39399a924bd4d27d67226a9a7f39.tar.gz |
worker: use container/list as job queue
The worker uses a buffered channel to queue tasks. Buffered channels
are effective at FIFO, but are prone to blocking. The design of aerc is
such that the UI must always accept a response from the backends, and
the backends must always accept a request from the UI. By using buffered
channels for both of these communication channels, a deadlock will
occur.
Break the chain by using a doubly linked list (container/list from the
standard library) to queue tasks for the worker. Essentially, this is an
infinitely buffered channel - but more memory efficient as it can change
size dynamically.
Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/sort')
0 files changed, 0 insertions, 0 deletions