Hi George! I was wrongly under the impression, that serializable-lambda are supposed to work out of the box, when sending them over channels, without needing to do any further work ("are serialized automatically" instead of "can be serialized"). This is what I would have expected, as it seems to be the case in other programming languages, where one can simply send lambdas to other actors, which can, but don't have to, run on other cores or other machines. A year ago or so there was an Racket event in Berlin (Racket Summerfest), where people also tried to use serializable-lambda to send them over channels, but did not succeed. I do not know what the problems there were, as I did not attend that specific workshop. However, I think some of the more knowledgeable people of the Racket community might remember that workshop. Maybe there also was some code from that event. If you know how to serialize those serializable-lambdas, it is possible, that you could solve the problems they faced.
I have a question regarding what you wrote: Is there a generic way to serialize such lambdas, no matter what they look like? I think that would be kind of necessary to abstract away the painful points of coming up with a way of serializing the lambdas. It also seems to be necessary for eventually creating a library, which provides a process pool, as such library possibly should be easy to use and not force the user to think about difficult thing, when the intention the user has seems so simple "just do that on another core". I have not read CSP and I know, that it is considered to be _the_ standard for multi processing, that much I have to admit. I am also not trying to argue the concept away : ) Just saying, that in Racket it is quite difficult (at least for me, although I have tried many hours, when I was working on my project) to get multi processing done. I believe in Python at least superficially one faces a similar situation: Threads on same core, processes can go on other core, which is the parallel to starting a new Racket VM, because it also starts a new Python process. However, somehow it is easily possible to give a reference or a lambda to a process pool in Python. I don't know the implementation details of course. Best regards, Zelphir On 10/9/19 1:36 PM, George Neuner wrote: > 1) Serial lambdas and closures are in web-server-lib, not the > framework. What is the problem including a library? > > 2) /serial-lambda/, /define-closure/, etc. only create functions that > CAN BE serialized. You still do have to (de)serialize them. > > 3) You can send serialized code over place channels - it is just a > string. > > > The difficulty in sending code is making sure all the support context > is available. To be sure, this can be a pain. But consider that for > a local place you can send the name of a code file to dynamic-require > ... and for a remote place you can send the file itself. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/0dbba335-fc99-b392-bc9b-2ad7736bf9ab%40gmail.com.