4 ms·
That's an incredibly general question. "It depends on the specifics" would be the general answer. Once you use FFI, there's no guarantee of memory safety as t
by spooneybarger 6y ago
That's an incredibly general question.
"It depends on the specifics" would be the general answer.
Once you use FFI, there's no guarantee of memory safety as the C code has access to the entire address space of the process. There is no sandboxing of foreign code at this time.
If the code you are calling isn't thread safe and you run your Pony program with more than 1 scheduler thread (pony actors get run on 1 or more scheduler threads- generally 1 per scheduler thread per CPU) then "bad things canhappen".
Becaue you are running unsafe code that can be accessed from multiple threads- but... well, maybe you can structure the Pony API so that you don't do that.
It really depends.
- magicalhippo 6y ago> maybe you can structure the Pony API so that you don't do that So from what I could gather from a quick glance through the tutorial, that would be to restrict the C code calls to a single actor, and have other actors call, I guess primarily through the async behaviors?
- spooneybarger 6y agoThat would be the general approach if possible with c code that isn't thread safe. It's a matter of if that is possible with a given library (it's difficult for example with GTK).