forking processes & using informix
Posted in 1991
I have a question for any Informix ESQL/C gurus. We're running Informix-SE version 4.00.UD3 on Sun SPARCs with SunOS 4.1.1. Our application is a real-time (or very close to real-time) application that processes and distributes Alarm reports. We're using the client-server model, and this application acts as the server. When a client connects, the server must: (1) register the client (2) get a list of all "active" alarm reports, and (3) send the list to the client The problem is that several clients may be connecting at the same time. Since the list of "active" alarm reports is dynamic, the server constructs a list of the alarm ID's (from the database). What we would like to be able to do is fork a child process to handle looking up the full alarm records and then send the record to the client. The child process is ONLY forked, no 'exec' is issued. We can't seem to have both the parent and a child access the database simultaneously; either the parent or ONE child can use the database at any given time. We've tried closing the database (in the parent) and then re-opening it from parent/child, closing the database from the child and issuing a SQLSTART from the child, issuing a SQLEXIT from the child and then opening or issuing SQLSTART from the child, etc. Nothing works. The desired result is one parent, multiple attached children all accessing the database simultaneously. Similar to lightweight processing in principle, except that the lightweight processes are simulated via "heavy" processes. Keep in mind that 'exec'ing is NOT a solution. What we're attempting is probably 'illegal' from Informix's viewpoint. I can't seem to get an answer from Informix Tech Support; the last I heard, they were researching it... Thanks for any help. Joseph P. Tokarski, Senior Software Engineer General DataComm, Inc. Middlebury, CT 06762 (203) 758-1811 ext. 7067 email: tokarski@nms.gdc.portal.com