CSET++ THREADS READ BLOCK

ITEM: RTA000051200



QUESTION:                                                                       
Customer has just started on threads programming using DCE pthreads,            
Cset++ 2.1.2 and AIX 3.2.5. and has asked the following question                
because he feels that reads and selects are blocking the entire                 
process and not just a single thread.                                           
                                                                                
 " What compiler options, linker options, library includes, etc ...             
   are needed to implement a threaded application (server)                      
   that utilizes select(), read() and write() and to have them                  
   only block within the context of a thread, NOT the parent process"           
                                                                                
Under what conditions would you block the entire process as                     
opposed to a single thread?                                                     
                                                                                
Could you give us some startup direction?                                      
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
QUESTION:                                                                       
The problem seems to relate to how to get access to jacket routines.            
The "Calling UNIX Services" article says that if you do not                     
wish to use any of the jacket routines then add #define_CMA_NOWRAPPERS          
which is the default in /etc/xlC.cfg under xlC_r. To use the                    
reentrant code you must apparently have the _CMA_NOWRAPPERS.                    
We are under the impression that the use of reentrant code should               
preclude the need for jacket routines but our tests do not indicate             
the blocking of only one thread is occurring. If you remove                     
_CMA_NOWRAPPERS many compile errors occur but if you look at /usr               
include/dce/cma_us.h you only get jacket routines if ( ¢defined(                
_CMA_NOWRAPPERS_). Their seems to be a conflict between                         
rentrant code and jacket routines for read and select or at                    
least conflicting information.                                                  
     We have installed                                                          
                                                                                
dcepthreads.obj                                                                 
      01.01.0000.0000 COMPLETE   APPLY      10/20/94   17:58:19 root            
U422532 01.01.0000.0000 COMPLETE   APPLY      10/20/94   20:11:06 root          
U428323 01.01.0000.0000 COMPLETE   APPLY      10/20/94   22:08:51 root          
U491143 01.01.0000.0000 COMPLETE   APPLY      10/20/94   20:11:36 root          
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: R:When DCE threads software is loaded, it modifies the /etc/xlc.cfg          
file and adds a "xlc_r" and a "cc_r" stanza to it. These are setup              
to link with libc_r which contains the thread safe routines as discussed        
in the DCE documentation (Application Development Guide).                       
                                                                               
The program will need to "#include ". If the application             
also uses DCE (other than the threads), a "-ldce" will also be needed           
as well as header files for the DCE components referenced.                      
                                                                                
There is another question very similar to this that can in from                 
AIX Support Line, that is experiencing the same problem, (the                   
entire process blocks instead of the thread). A PMR has been                    
opened against this. The PMR number is 2X747, B469.                             
As soon as an answer is received for the PMR, I will append the                 
answer here. You are welcome to monitor the PMR as well.                        
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: In the PMR mentioned earlier, the reason why the process blocked             
was due to an open() on a FIFO type file. A FIFO is a special file              
that when accessed via an open() will block the entire process unless          
it is opened in a non-blocking manner.                                          
   In order to isolate the problem your customer is experiencing,               
the code would be needed. It would make it much easier to analyze if            
it is a small test program with its makefile.                                   
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                                
                                                                                
This item was created from library item Q674726      FDRHM                      
                                                                                
Additional search words:                                                        
BLKD BLOCK COMPILERS CSET DEC94 FDRHM IX OZIBM OZNEW RDR READ READER            
READS RISCL RISCSYSTEM SOFTWARE THREADS                                         
                                                                                
                                                                               


WWQA: ITEM: RTA000051200 ITEM: RTA000051200
Dated: 06/1996 Category: RISCL
This HTML file was generated 99/06/24~12:43:19
Comments or suggestions? Contact us