From: Brian G. <br...@ge...> - 2008-11-21 18:32:23
|
On Nov 17, 2008, at 10:29 AM, Edwin Simons wrote: > I'm fairly new to player, but I have been tasked with achieving the > following goal. I need player to be able to load a new device driver > some time after it has started, without restarting. Is this at all > possible in Player right now? If so, how do I do it? If not, would > it be > possible for me to modify existing code to achieve this goal? If so, > what would I need to modify? Any help or advice would be greatly > appreciated. Thank you for your time. That's not something we designed for, but in principle, it's quite possible. Have a look at libplayercore/plugins.cc and libplayercore/ configfile.cc. In the latter, ConfigFile::ParseDriver() calls LoadPlugin() when a driver block specifies a plugin to be loaded. It then calls InitDriverPlugin(), which reaches into the plugin and calls player_driver_init(), which presumably adds the driver to the driverTable. You could call LoadPlugin() and InitDriverPlugin() during execution. Two things to be done: - add a mutex to driverTable and ensure that it's locked when the table is accessed. Right now, there's no locking, because the table is only mutated on startup, in a non-concurrent fashion. - provide a mechanism to tell the server to actually do the load. Without knowing anything about your use case, I can't say what would be the best way to do this, among several possibilities (e.g., send a signal, write to a fifo, add a new server request message). This sounds like neat functionality that we'd happily incorporate once you have it working. brian. |