What is STM Lua?

The concurrency programming is more and more popularly and impotent. The hard ware now is building more and more multi-cores in one CPU. To increase the efficient of the data process. On the other sides, the software also supports ways to achieve the concurrency programming. Use Locking, STM (Software Transaction Memory) and so on. And this project is implemented by STM and Lua. Why choose STM and not Locking. Because the STM is lock-free. Only after process, it need lock to let resource cannot be available to others. If it finds other one use it, it will restart process the data. Compare STM with Locking, the STM can avoid dead lock and live lock and most of time is more efficient than Locking. Lua is a powerful, fast, lightweight, simple, embeddable scripting language. Lua can run on all kinds of UNIX and Windows, and mobile devices as well. I build my project to a Lua library, and then any one use Lua can require this library to achieve concurrency.

STM & Lua

software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. A transaction in this context is a piece of code that executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions.

Lua is a powerful, fast, lightweight, embeddable scripting language. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, runs by interpreting bytecode for a register-based virtual machine, and has automatic memory management with incremental garbage collection, making it ideal for configuration, scripting, and rapid prototyping.