Hi all,
I've written a service application that provides a HTTP server. It uses a database driven menu system to provide different webpages (system management stuff). I've written the first few functions and all is ok. Now I want to deploy for many people to be able to use, but also continue development on new functions without interrupting anyone who may be using the existing functions - at the moment, I'll need to stop the service, copy across the updated .exe and restart the service.
It occurred to me that I could use dynamic packages - when a function is used, it loads the package, and unloads when done. Adding new packages or modifying existing packages should be as easy as a copy/paste of the .BPL file, and no stop/restart of the service application is required.
Before I embark on this approach, I've realised that this is a multi-threaded environment - the package load/unloads will occur during one of the TIdHTTPServer context threads. So if two people are trying to use the same function, it would try to load the same package twice. I've googled for information on whether this is allowed or not, and can't find anything.
Do I need to manage the package loading/unloading outside of the TIdHTTPServer thread context? Or can the same package be loaded multiple times? Or should I be staying away from this type of thing altogether for this project?
Your thoughts and experience are much appreciated.
Thanks,
Griffyn
I've written a service application that provides a HTTP server. It uses a database driven menu system to provide different webpages (system management stuff). I've written the first few functions and all is ok. Now I want to deploy for many people to be able to use, but also continue development on new functions without interrupting anyone who may be using the existing functions - at the moment, I'll need to stop the service, copy across the updated .exe and restart the service.
It occurred to me that I could use dynamic packages - when a function is used, it loads the package, and unloads when done. Adding new packages or modifying existing packages should be as easy as a copy/paste of the .BPL file, and no stop/restart of the service application is required.
Before I embark on this approach, I've realised that this is a multi-threaded environment - the package load/unloads will occur during one of the TIdHTTPServer context threads. So if two people are trying to use the same function, it would try to load the same package twice. I've googled for information on whether this is allowed or not, and can't find anything.
Do I need to manage the package loading/unloading outside of the TIdHTTPServer thread context? Or can the same package be loaded multiple times? Or should I be staying away from this type of thing altogether for this project?
Your thoughts and experience are much appreciated.
Thanks,
Griffyn