Mar-07-2024, 03:40 PM
(This post was last modified: Mar-07-2024, 03:40 PM by deanhystad.)
Is "don't use windows" an acceptable answer? Your application uses pickle because multiprocessing in windows spawns processes. New processes don't share any resources with the parent process. If you did this on Linux (or maybe on mac?) the new processes would be forked. The new process starts knowing everything the parent process did up to that point. You would have no problem with passing a websocket to the new process because the websocket object would exist in both processes with no serialization required.
If you can't do that, how about making your main process a server application? The main process creates a thread to listen for connect requests.
The spawned processes open a socket connection to the server and pass facial recognition information (some sort of image?) to the server. I don't know a lot about web anything, but this is how I would create an application like this using normal sockets.
If you can't do that, how about making your main process a server application? The main process creates a thread to listen for connect requests.
The spawned processes open a socket connection to the server and pass facial recognition information (some sort of image?) to the server. I don't know a lot about web anything, but this is how I would create an application like this using normal sockets.