简体   繁体   中英

C++ Linux service initialization

I create a C++ program for prediction using ANN. I took a long time to initialize models but after loading them it can predict quickly. How can I create a service using this executable file that loads models one time (when OS starts) and after loading I using it for prediction?

You can break your program into two parts, a server and clients. The server can initialize models and be ready for predictions. The server can start as a service when the sytems starts. Use systemd for installing the service so that it starts after the system boot. The clients can provide the user interface for predictions and can communicate with the server using some inter process communication mechanism.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM