Skip to content

Commit c5891de

Browse files
committed
Add note in story about reqs changing and uncertainty
1 parent 9e0bd1c commit c5891de

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/vision/status_quo/grace_wants_to_integrate_c_api.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ cameras instead of 1.
3434

3535
She knows from experience that she cannot rely on having 5 threads blocking just for getting camera frames, because the
3636
embedded system she is deploying to only has 2 cores total! Her team would be introducing a lot of overhead into the
37-
system with the continuous context switching of every thread. Fortunately, Grace notices the similarities between the
38-
polling interface in the underlying C library and the `Poll` type returned by Rust's `Future` trait. "Surely," she
39-
thinks, "I can asynchronously interleave polls to each camera over a single thread, and process frames as they become
40-
available!" Such a thing would be quite difficult in C while guaranteeing memory safety was maintained. However, Grace's
41-
team has already dodged that bullet thanks to writing a thin wrapper in Rust that manages these tricky lifetimes!
37+
system with the continuous context switching of every thread. Some folks were unsure of Rust's asynchronous
38+
capabilities, and with the requirements changing there were some that argued maybe they should stick to the tried and
39+
true in pure C. However, Grace eventually convinced them that the benefits of memory safety were still applicable, and
40+
that a lot of bugs that have taken weeks to diagnose in the past have already been completely wiped out. The team
41+
decided to stick with Rust, and dig deeper into implementing this project in async Rust.
42+
43+
Fortunately, Grace notices the similarities between the polling interface in the underlying C library and the `Poll`
44+
type returned by Rust's `Future` trait. "Surely," she thinks, "I can asynchronously interleave polls to each camera over
45+
a single thread, and process frames as they become available!" Such a thing would be quite difficult in C while
46+
guaranteeing memory safety was maintained. However, Grace's team has already dodged that bullet thanks to writing a thin
47+
wrapper in Rust that manages these tricky lifetimes!
4248

4349
### The first problem: polls and wake-ups
4450

0 commit comments

Comments
 (0)