Revision 1192

branches/threaded2/src/linad99/thread_stuff.cpp (revision 1192)
851 851

  
852 852
void adpthread_manager::create_all(void * ptr)
853 853
{
854
  pthread_attr_t policy_attr;
855
  pthread_attr_init(&policy_attr);
856
  #undef USE_FIFO_POLICY
857
  #ifdef USE_FIFO_POLICY
858
  int old_policy;
859
  //int pthread_attr_getschedpolicy(pthread_attr_t *attr, int *policy);
860
  pthread_attr_getschedpolicy(&policy_attr, &old_policy);
861
  cerr << "In adpthread_manager::create_all, old_policty = " << old_policy << endl;
862

  
863
  // int pthread_attr_setschedpolicy(pthread_attr_t *attr, int policy);
864
  pthread_attr_setschedpolicy(&policy_attr, SCHED_FIFO);
865
  cerr << "In adpthread_manager::create_all, set policy to = " << SCHED_FIFO << endl;
866
  #endif //USE_FIFO_POLICY
867
  
868
  //int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched);
869
  pthread_attr_setinheritsched(&policy_attr, PTHREAD_EXPLICIT_SCHED);
870

  
854 871
  new_thread_data * dptr = (new_thread_data *)ptr; 
855 872
  int ii=0;
856 873
  for (int i=1;i<=ngroups;i++)
......
865 882
    {
866 883
      cout << ppf[i] << endl;
867 884
      ++ii;
868
      pthread_create(thread1+ii,NULL,ppf[i],dptr+ii);
885
      //pthread_create(thread1+ii,NULL,ppf[i],dptr+ii);
886
      pthread_create(thread1+ii,&policy_attr,ppf[i],dptr+ii);
869 887
    }
870 888
  }
871 889
}
branches/threaded2/examples/threaded/multisimple/msimple.dat (revision 1192)
1 1
# $Id: msimple.dat 3054M 2013-01-10 23:50:00Z (local) $
2 2
# http://www.mathematical.com/primes1000kto2000k.html
3 3
# nobs     threads
4
 1000003    1
4
 1000003    2
5 5
# 100     1
6 6

  

Also available in: Unified diff