/parallel

并行化稀疏表示中的正交匹配追踪 OMP算法;编写基于C++98版本的线程池,并学习编写在并发条件下的hash线程安全编写!

Primary LanguageC++

并行化程序

并行化OMP(正交匹配追踪)

线程池(pthread版本)

生产者消费者模型

  • C语言版本
thread 1:
    pthread_mutex_lock(&mutex);
    while (!condition)
        pthread_cond_wait(&cond, &mutex);
    /* do something that requires holding the mutex and condition is true */
    pthread_mutex_unlock(&mutex);

thread2:
    pthread_mutex_lock(&mutex);
    /* do something that might make condition true */
    pthread_cond_signal(&cond);
    pthread_mutex_unlock(&mutex);
  • C++语言版本