40 likes | 270 Views
CS3516. Administrivia – November 11, 2013. Project 1. Checkpoint: November 14 at 12:01 AM Show and Tell: November 14 & 15. Signup for Show and Tell early to get the timeslot you want. It’s available NOW! If you’re near the end of the signup and you can’t get a slot that works:
E N D
CS3516 Administrivia – November 11, 2013
Project 1 • Checkpoint: November 14 at 12:01 AM • Show and Tell: November 14 & 15. • Signup for Show and Tell early to get the timeslot you want. It’s available NOW! • If you’re near the end of the signup and you can’t get a slot that works: • 1) Try swapping with a buddy • 2 e-mail the TAs
Project 1 ANY QUESTIONS The starter code for Project1_thread_example.c did not run successfully on all environments. Download the latest version and you should have better success on the CCC machines.
Project 1 unsigned intCreateAThread( void *ThreadStartAddress, int *data ) { intReturnCode; pthread_t Thread; pthread_attr_t Attribute; ReturnCode = pthread_attr_init( &Attribute ); if ( ReturnCode != 0 ) printf( "Error in pthread_attr_init in CreateAThread\n" ); ReturnCode = pthread_attr_setdetachstate( &Attribute, PTHREAD_CREATE_JOINABLE ); if ( ReturnCode != 0 ) printf( "Error in pthread_attr_setdetachstate in CreateAThread\n" ); ReturnCode = pthread_create( &Thread, &Attribute, ThreadStartAddress, (void *)*data ); if ( ReturnCode == EINVAL ) /* Will return 0 if successful */ printf( "ERROR doing pthread_create - The Thread, attr or schedparam is wrong\n"); if ( ReturnCode == EAGAIN ) /* Will return 0 if successful */ printf( "ERROR doing pthread_create - Resources not available\n"); if ( ReturnCode == EPERM ) /* Will return 0 if successful */ printf( "ERROR doing pthread_create - No privileges to do this schedule type\n"); ReturnCode = pthread_attr_destroy( &Attribute ); if ( ReturnCode ) /* Will return 0 if successful */ printf( "Error in pthread_mutexattr_destroy in CreateAThread\n" ); return( (unsigned int)Thread ); } // End of CreateAThread