On Tuesday 04 December 2001 23:51, [EMAIL PROTECTED] wrote: > Hey crew, > > I'm running an rtl control system, the heart of which is a thread that > calls a number of functions and sums their return values. Rather than > name the functions directly, I have them indexed in a function array, > and I set the specific values of the array from shared memory. This > allows me to add and remove various control algorithms, without having > to keep all possible control algorithms (100s of real time modules) > permanently loaded. > > But it's clunky - because when I insert a new module, rtlinux doesn't > know about the thread's dependency upon the control functions within > that module, so if I accidentally type 'rmmod control_module' before > 'rmmod my_rt_thread', the system promptly locks up. In the interest of > letting naive user play with this without freezing the system so > easily, I was wondering if there was a less clunky way? Is it possible > to modify the dependencies directly?
If you just put the shared function pointers in the my_rt_thread module, or have it export a simple register/unregister API, this will have the kernel keep track of the dependencies automatically. You can't unload a module that exports symbols that other loaded modules import. Of course, that means that my_rt_thread will have to be loaded *first* - but I can't see a real problem with that. For example, you can have the register/unregister calls automatically start the RT thread when there is code to run, and stop it again when the last function has been unregistered. //David Olofson --- Programmer, Reologica Instruments AB .- M A I A -------------------------------------------------. | Multimedia Application Integration Architecture | | A Free/Open Source Plugin API for Professional Multimedia | `----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter | `-------------------------------------> http://olofson.net -' -- [rtl] --- To unsubscribe: echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED] -- For more information on Real-Time Linux see: http://www.rtlinux.org/
