From owner-state-threads@oss.sgi.com Sun May 20 12:12:14 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f4KJCED21299 for state-threads-outgoing; Sun, 20 May 2001 12:12:14 -0700 Received: from femail9.sdc1.sfba.home.com (femail9.sdc1.sfba.home.com [24.0.95.89]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f4KJCEF21296 for ; Sun, 20 May 2001 12:12:14 -0700 Received: from [24.11.49.110] by femail9.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20010520191207.NEAB17191.femail9.sdc1.sfba.home.com@[24.11.49.110]> for ; Sun, 20 May 2001 12:12:07 -0700 Received: (nullmailer pid 334 invoked by uid 1000); Sun, 20 May 2001 19:07:22 -0000 Date: Sun, 20 May 2001 15:07:22 -0400 From: Dan Melomedman To: state-threads@oss.sgi.com Subject: IPC model Message-ID: <20010520150722.A326@home.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-state-threads@oss.sgi.com Precedence: bulk I am writing a POP3 server that must have an ability to do LDAP authentication (search a database in remote server). I am going to be using OpenLDAP 2.0.x libraries for now. Does this mean that a process could be potentially blocked, even though OpenLDAP does have asynchronous search functions? If so, what would be an efficient and state-thread safe method of IPC, if I split the server into two (one being the POP3 server, the other being help processes that will accomplish LDAP authentication and return a response to a thread via IPC). I would also have the helper processes eventually do disk read I/O for the server. One way of doing this could be a FIFO or a local Unix socket (DGRAM or STREAM)? I can see that doing this with SysV message queues would be the easiest, but I do not want to support SysV message queues problems. I cannot see how this could be accomplished with UDP sockets because the helper process could grab its own response instead of getting it to the thread that requested it. What about synchronization problems, response ordering, request ordering? Any examples out there? Any help would be greately appreciated. P.S. I e-mailed Vivek S. Pai to access their source, but so far got no response back. From owner-state-threads@oss.sgi.com Mon May 21 15:55:27 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f4LMtRa23133 for state-threads-outgoing; Mon, 21 May 2001 15:55:27 -0700 Received: from sgi.com (sgi.SGI.COM [192.48.153.1]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f4LMtQF23130 for ; Mon, 21 May 2001 15:55:26 -0700 Received: from trudge.engr.sgi.com ([163.154.38.51]) by sgi.com (980327.SGI.8.8.8-aspam/980304.SGI-aspam: SGI does not authorize the use of its proprietary systems or networks for unsolicited or bulk email from the Internet.) via ESMTP id PAA04836 for ; Mon, 21 May 2001 15:55:26 -0700 (PDT) mail_from (mja@trudge.engr.sgi.com) Received: (from mja@localhost) by trudge.engr.sgi.com (980427.SGI.8.8.8/970903.SGI.AUTOCF) id PAA10411; Mon, 21 May 2001 15:53:09 -0700 (PDT) From: mja@trudge.engr.sgi.com (Mike Abbott) Message-Id: <200105212253.PAA10411@trudge.engr.sgi.com> Subject: Re: IPC model To: dmelomed@home.com (Dan Melomedman) Date: Mon, 21 May 2001 15:53:09 -0700 (PDT) Cc: state-threads@oss.sgi.com In-Reply-To: <20010520150722.A326@home.com> from "Dan Melomedman" at May 20, 2001 03:07:22 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-state-threads@oss.sgi.com Precedence: bulk > I am going to be using OpenLDAP 2.0.x libraries for now. > Does this mean that a process could be potentially blocked, even though > OpenLDAP does have asynchronous search functions? That depends on whether OpenLDAP ever issues any blocking I/O calls, whether to disk, network, or a pipe. > If so, what would be > an efficient and state-thread safe method of IPC, if I split the server > into two (one being the POP3 server, the other being help processes that > will accomplish LDAP authentication and return a response to a thread > via IPC). I would also have the helper processes eventually do disk read > I/O for the server. Use the State Thread Library's I/O functions over a pipe or TCP socket pair. See http://oss.sgi.com/projects/state-threads/docs/notes.html#disk If you port OpenLDAP to use the State Thread Library's I/O functions instead of native functions (st_write instead of write on sockets) it can run in the same process. If it does disk I/O though the asymmetric architecture performs better. -- Michael J. Abbott mja@sgi.com www.repbot.org/mike From owner-state-threads@oss.sgi.com Mon May 21 20:06:13 2001 Received: (from majordomo@localhost) by oss.sgi.com (8.11.3/8.11.3) id f4M36Dx27599 for state-threads-outgoing; Mon, 21 May 2001 20:06:13 -0700 Received: from femail8.sdc1.sfba.home.com (femail8.sdc1.sfba.home.com [24.0.95.88]) by oss.sgi.com (8.11.3/8.11.3) with ESMTP id f4M36CF27596 for ; Mon, 21 May 2001 20:06:12 -0700 Received: from [24.11.49.110] by femail8.sdc1.sfba.home.com (InterMail vM.4.01.03.20 201-229-121-120-20010223) with SMTP id <20010522030611.FZVZ578.femail8.sdc1.sfba.home.com@[24.11.49.110]> for ; Mon, 21 May 2001 20:06:11 -0700 Received: (nullmailer pid 444 invoked by uid 1000); Tue, 22 May 2001 03:01:24 -0000 Date: Mon, 21 May 2001 23:01:24 -0400 From: Dan Melomedman To: state-threads@oss.sgi.com Subject: Re: IPC model Message-ID: <20010521230124.A424@home.com> References: <20010520150722.A326@home.com> <200105212253.PAA10411@trudge.engr.sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200105212253.PAA10411@trudge.engr.sgi.com>; from mja@trudge.engr.sgi.com on Mon, May 21, 2001 at 03:53:09PM -0700 Sender: owner-state-threads@oss.sgi.com Precedence: bulk On Mon, May 21, 2001 at 03:53:09PM -0700, Mike Abbott generated a stream of 1s and 0s: > > I am going to be using OpenLDAP 2.0.x libraries for now. > > Does this mean that a process could be potentially blocked, even though > > OpenLDAP does have asynchronous search functions? > > That depends on whether OpenLDAP ever issues any blocking I/O calls, > whether to disk, network, or a pipe. > Yes, OpenLDAP uses blocking I/O, network only. > > If so, what would be > > an efficient and state-thread safe method of IPC, if I split the server > > into two (one being the POP3 server, the other being help processes that > > will accomplish LDAP authentication and return a response to a thread > > via IPC). I would also have the helper processes eventually do disk read > > I/O for the server. > > Use the State Thread Library's I/O functions over a pipe or TCP socket > pair. See > http://oss.sgi.com/projects/state-threads/docs/notes.html#disk > > If you port OpenLDAP to use the State Thread Library's I/O functions > instead of native functions (st_write instead of write on sockets) it > can run in the same process. If it does disk I/O though the asymmetric > architecture performs better. > -- > Michael J. Abbott mja@sgi.com www.repbot.org/mike Porting would probably be too much of effort to justify what I am trying to accomplish it looks like quite a bit of code. Besides I don't think anyone else is interested in OpenLDAP supporting state threads :(. Do I have to use st_ functions in the help processes also (forked from main daemon processeses), OR can I have the help processes run separarately as a second daemon communicating over a named pipe or a BSD domain socket by any chance?