Multithreading with Lua
In the previous chapter, we learned some techniques to manage resources when integrating Lua into C++. In this chapter, we will learn how to work with multithreading with Lua. If you use Lua in a complex project, chances are that you need to create multiple Lua instances. First, we will learn how to contain the multithreading part in C++ and make Lua unaware of it. Then, we will see how Lua handles multithreading, in case you need to use it. Understanding multithreading will help with the technical planning for your projects.
We will cover the following topics:
- Multithreading in C++
- Multithreading in Lua
- Using
coroutine
with C++