https://github.com/d-led/pony_lua_parallel
using Pony to parallelize a single threaded C program (Lua)
https://github.com/d-led/pony_lua_parallel
Last synced: 4 months ago
JSON representation
using Pony to parallelize a single threaded C program (Lua)
- Host: GitHub
- URL: https://github.com/d-led/pony_lua_parallel
- Owner: d-led
- License: unlicense
- Created: 2020-01-22T14:23:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-06T10:13:44.000Z (almost 5 years ago)
- Last Synced: 2025-10-05T07:47:27.791Z (9 months ago)
- Language: Pony
- Size: 484 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pony_lua_parallel
using Pony to parallelize a single threaded C program (Lua)
[](https://travis-ci.com/d-led/pony_lua_parallel) [](https://ci.appveyor.com/project/d-led/pony-lua-parallel/branch/master)
## Building and Running
### Docker
```bash
docker-compose build --build-arg MAX_NUM=40
```
re-run:
```bash
docker-compose run -e MAX_NUM=40 pony
```
### Pony
- Install [Pony](https://github.com/ponylang/corral)
- `ponyc`
- run `pony_lua_parallel`
### CI
- Travis-CI runs on 1 virtual core, thus parallelism effects cannot be observed there.
```
Can't have --ponymaxthreads > physical cores, the number of threads you'd be running with (2 > 1)
```
- Appveyor seems to run on more than 1 core, and thus some parallelism can be observed
## Contents
See [main.pony](main.pony):
- `synchronous_demo`: calling [Lua](https://www.lua.org/manual/5.3/) synchronously from [Pony](http://tutorial.ponylang.org/) via [FFI](https://tutorial.ponylang.io/c-ffi.html)
- `asynchronous_demo`: creating an actor owning a Lua instance upon each request, and [waiting](https://stdlib.ponylang.io/promises-Promises/#join) for asynchronously arriving results via [Promises](https://patterns.ponylang.io/async/actorpromise.html)
- `lua_sending_messages_demo`: creating a fixed number of worker actors in Pony, and dispatching work to them from Lua
- [lua.pony](lua.pony): the problem-specific FFI based Lua 5.3 wrapper class