book-exploring-async-basics
book-exploring-async-basics copied to clipboard
[Translation] 8_9_infrastructure.md
Even though we use several threads, we use a regular
usizehere
What does the word regular here mean? Can I regard it as simple?
We do the latter since that's the only thing that makes sense for our use case.
It needs to be
'Sendsince we're sending this task to another thread.
I am wondering why there is a ' in front of the word Send?
What does the word regular here mean? Can I regard it as simple?
By regular I mean not an AtomicUsize just the normal usize. I guess, if you need to use another word "normal" is more correct but you can use "simple" as well if you want to. Neither is incorrect I would say.
I am wondering why there is a ' in front of the word Send?
It's a spelling mistake. I probably hit the wrong key trying to make a ` It shouldn't be there.
one more question about the comment in the code
// We would normally return None and the request and not panic!
The current situation is return thread_id or panic!, but practically we should not panic!, am I right?
Yeah, the right thing would be to either return None and let the caller decide what to do when there are no available threads, or implement some logic that queues the request for a thread and returns once it's available. Panicking this way is bad but accetable since we're just creating a simple example.
That's also a bad sentence on my part, it shuld be: // We would normally return None and not panic!.
I'll correct that as well.