Summary
With that, we have wrapped up the final chapter of this book. In this chapter, we focused on multithreading mechanisms, preemptive multithreading and cooperative multithreading, and Lua coroutines.
Lua coroutines can be used without C++ for advanced Lua programming and you can hide all these details from C++. We only touched the tip of the iceberg. You can read the Lua reference manual and practice more. You can also explore more on how to use coroutines with C++ by experimenting with the related Lua library functions.
In this book, we implemented LuaExecutor
progressively. Each chapter added more features to it. However, it is not perfect. For example, LuaValue
can be improved to make it easier to work with, and LuaExecutor
can support more table operations. You can use LuaExecutor
as a base and adapt it to your project or implement your own in a completely different way after you have learned the mechanisms.
I am confident that at this point, you can make improvements...