For this we need to understand how Process class works and which method should we override
queue.Queue can't be used for multiple Process. For this multiprocessing provides its own queue(s). From which I have used JoinableQueue just because they can be joined (if we need to terminate, then program should wait till all items in queue are processed)
Synchronization is needed between process. First Consumer is started, all other producers process should wait till Consumer is ready to process frames (loading models in GPU takes time)
For this I have used multiprocessing.Event which is same as threading.Event
For this companies/developers earlier used to create service using crontab. Now every softwares for linux is handled through systemd. With systemd it is easy to handle services. We can send TERM signal using systemctl. These signals can be handled through signal module in python
To create systemd service, we need to create *.service file. We can also restrict hardware usage using *.slice file (For EduFace, I have restricted RAM to 12 GB ). Restricting hardware resource was not possible through crontab.
After creating *.service files, we have to move them to /etc/systemd/system/
To start/stop/restart service
foo@bar:~$ sudo systemctl start/stop/restart *.serviceTo check status of service
foo@bar:~$ sudo systemctl status *.serviceTo view all service log
foo@bar:~$ sudo journalctl -u *.service To view last lines of log
foo@bar:~$ sudo journalctl -u *.service -fTo start service at every boot:
foo@bar:~$ sudo systemctl enable *.service