Resource allocation

It is recommended that you include the DCE pthread_yield() call in tight loops to remind the scheduler to allocate resources as necessary. The call to pthread_yield() instructs the DCE scheduler to try to uniformly allocate resources if a thread is caught in a tight loop, waiting for a connection (thus preventing other threads from proceeding). The following code fragment shows a call to the pthread_yield() routine:
/* loop until the connection is available*/
do 
   {
   EXEC SQL set connection  :con_name;
   pthread_yield();
   } while (SQLCODE == -1802);