Summary
In this chapter, we started by providing a brief introduction to concurrency and parallelism by explaining these concepts while looking at brief examples. We then understood the basic terminologies related to concurrent programming, such as program, process, thread, and task. We then understood the syntax that's used to write concurrent programs in V using the go
keyword. We also understood the basic programming modules in V, such as the time
module and the thread
type.
Later, based on a real-life scenario that I explained to help you understand concurrency in the introduction to this chapter, we learned how to implement the sequential and concurrent versions of this scenario programmatically in V. We then compared both the sequential and concurrent programs and understood the benefits of concurrent programming over sequentially executing tasks. While explaining the scenario that we implemented programmatically, we also learned how to spawn multiple tasks using []thread...