[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rtl] RTAI and RTLinux



On Fri, Sep 08, 2000 at 02:12:20AM +0100, Steve Papacharalambous wrote:
> yodaiken@fsmlabs.com wrote:
> > All that said and done, however, since implementing a cache memory pool is the work of maybe
> > an hour, at best, this discussion is more about philosophy of design than about anything concrete.
> 
> Hi Victor,
> 
> For me this is less a matter of philosophy, rather it is a matter of
> necessity.  It's a normal design requirement to be able to dynamically
> create and destroy threads from within another thread.  The lack of this
> capability in RTLinux is a significant limitation,

I'm perhaps to dense to see this:

null_start(void *arg){  
            int i = (int ) arg;
            while(!die[i]){
                      pthread_suspend_np(pthread_self());
                      if(thread_function[i]) thread_function[i](i);
                      thread_function[i] = 0;
                      }
             return;
         }

module_init:
       pthread_t my_threads[NUMBER_OF_THREADS_WE_MIGHT_NEED];

        for(i=0; i < NUMBER_OF_THREADS_WE_MIGHT_NEED; i++)
             pthread_creat(&my_threads[i],null_start, ... );



/* can be called even from a RT interrupt */
activate_a_thread(i,f){
                if(!thread_function[i])thread_function[i] = f;
                pthread_kill(my_threads[i], RTL_SIG_WAKEUP);
                }


...

add some synchronization and ...

Am I missing something?



> 
> Best regards,
> 
> Steve
> 
> -- 
> 
> Lineo Industrial Solutions Group
> Visit http://www.lineo.com/
> 

-- 
---------------------------------------------------------
Victor Yodaiken 
Finite State Machine Labs: The RTLinux Company.
 www.fsmlabs.com  www.rtlinux.com