Ignore:
Timestamp:
12/16/2006 10:39:50 PM (13 years ago)
Author:
art
Message:
  • Friendly thread execution added (yielding of threads and main thread)
  • Test directory added, where simple test programms will be build
  • Each Makefile now contains the TOPDIR variable
File:
1 edited

Legend:

Unmodified
Added
Removed
  • nrEngine/include/IThread.h

    r11 r12  
    7070         * methods in ITask interface. 
    7171         * 
     72         * Our threads does yield their time slice to another threads after each execution cycle. 
     73         * In this manner we get a friendly and intuitive behaviour of threads running in parallel. 
     74         * 
    7275         * NOTE: The IThread interaface and Kernel does do all the job for you to manage 
    7376         * themself as a threads and to let them run in parallel. The only one thing it 
     
    129132                         **/ 
    130133                        static void* run(void* mythread); 
    131                         //static void run(IThread* mythread); 
    132134 
    133135                        //! Kernel is a friend class 
    134136                        friend class Kernel; 
    135137 
     138                        /** 
     139                         * Call the appropriate yield method of the threading library. 
     140                         * The thread calling this method will yield its remaining timeslice 
     141                         * to other threads. 
     142                         * 
     143                         * @param mythread Pointer to the thread which yields. 
     144                         *              If NULL specified, so the called thread will be yield. 
     145                         **/ 
     146                        static void yield(IThread* mythread = NULL); 
     147                         
    136148                        /** 
    137149                         * Kernel does call this method if the appropriate task is running 
     
    178190 
    179191                        // Mutex to lock the data before use 
    180                         //pthread_mutex_t mMutex; 
     192                        // pthread_mutex_t mMutex; 
    181193 
    182194                        //! Store here the thread instance 
     
    184196 
    185197                        //! Thread attributes 
    186                         pthread_attr_t mThreadJoinableAttr; 
     198                        pthread_attr_t mThreadAttr; 
    187199                         
    188200                        //! Change a thread to new state, use mutex to lock the state 
Note: See TracChangeset for help on using the changeset viewer.