11
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++
Technical requirements
We will use the source code from Chapter 10 as a base to develop ...
Get Integrate Lua with C++ now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.