Great link - thanks for posting! Pulsar can be configured to use either processes or threads. If you use processes, you pay the IPC penalty, just like NodeJS does. If you use threads, you pay the GIL penalty. So yeah, it won't be as fast as BEAM or the JVM either way. |
So from my understanding, if you're using processes, then pulsar will connect event loops to ports (with their mailboxes) for sending and receiving messages. If you're using threads, it will basically just be using the python Threading module (with all the GIL issues). How accurate/inaccurate is my understanding?
Also - what is the "IPC" penalty the comment mentions? Is it really going to be that much slower than erlang or java?
If Threading does get locked by the GIL, is there a way to get around that for multiple cores, maybe with Cython?
Finally, how do you configure pulsar to use one or the other in the first place?
2) In the documentation (https://quantmind.github.io/pulsar/design.html) it mentions using executor() for intense processes. I can't find this function anywhere or in the code - what is this referring to, and what are its use cases? Can you show an example?
3) In the example remote.py (https://github.com/quantmind/pulsar/blob/master/examples/snippets/remote.py), what exactly is the metaclass doing? I understand what a metaclass is and does, but the code confuses me. It has the same for loop twice. Is it just creating a class attribute that has the names of all the remote functions?
Apologies for so many questions. Pulsar looks really great. I am just new to this area of programming and have a lot of things to learn :).