|
|
|
|
|
by ttfkam
1021 days ago
|
|
Threads are for doing your own work in parallel. Async is for waiting on others to do their work in parallel. Your own work would be some CPU-intensive operations you can logically divide and conquer. Others' work would be waiting for file I/O from the OS, waiting for a DB result set following a query, waiting for a gRPC response, etc. Conceptually quite distinct, and there are demonstrated advantages and drawbacks to each. Right tool for right job and all that. |
|