Linux、Xenomai、RTAIのPREEMPT_RTパッチを私の論文のベンチマークに使うために、ExpressLogicからPOSIXでリアルタイムThread_Metricを移植しようとしています。今、私はとしてのpthreadを取るた、tm_thread_suspendとtm_thread_resume機能を実装しようとしているpthreadを入力として受け取り、中断する関数
void tm_initialize(void (*test_initialization_function)(void));
int tm_thread_create(int thread_id, int priority, void (*entry_function)(void));
int tm_thread_resume(int thread_id);
int tm_thread_suspend(int thread_id);
void tm_thread_relinquish(void);
void tm_thread_sleep(int seconds);
int tm_queue_create(int queue_id);
int tm_queue_send(int queue_id, unsigned long *message_ptr);
int tm_queue_receive(int queue_id, unsigned long *message_ptr);
int tm_semaphore_create(int semaphore_id);
int tm_semaphore_get(int semaphore_id);
int tm_semaphore_put(int semaphore_id);
int tm_memory_pool_create(int pool_id);
int tm_memory_pool_allocate(int pool_id, unsigned char **memory_ptr);
int tm_memory_pool_deallocate(int pool_id, unsigned char *memory_ptr);
:彼らはあなたがベンチマークが動作するために実装する必要があり、以下の機能を備えたCソースファイルを、提供します入力。私はpthread_mutex_lockとpthread_cond_waitルーチンでpthreadを中断できることを知っていますが、これらをstart_functionスレッドから呼び出さなければなりません。私はこの種のもので新しく、私は頭の中でやり遂げています。どんな助けもありがとうございます。
'pthread_suspend'はpthread関数ではなく、ベンダー拡張です。 –
'pthread_suspend()とpthread_continue()はX/Openによって開発されました。 – bmargulies
まだ標準には含まれていません。あなたはおそらく理論的な文書を掘り下げ、かなり良い理由を見つけることができます。 –