using Pony to parallelize a single threaded C program (Lua)
docker-compose build --build-arg MAX_NUM=40
re-run:
docker-compose run -e MAX_NUM=40 pony
- Install Pony
ponyc
- run
pony_lua_parallel
- 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
See main.pony:
synchronous_demo
: calling Lua synchronously from Pony via FFIasynchronous_demo
: creating an actor owning a Lua instance upon each request, and waiting for asynchronously arriving results via Promiseslua_sending_messages_demo
: creating a fixed number of worker actors in Pony, and dispatching work to them from Lua- lua.pony: the problem-specific FFI based Lua 5.3 wrapper class