Re: AfterStep and *BSD [ was Re: more wharf problems. ]

Ethan (
Mon, 14 Jun 1999 23:40:58 -0700 (PDT)

On Tue, 15 Jun 1999, Frederick Bruckman wrote:

> On Mon, 14 Jun 1999, Phillip J. Rulon wrote:
> > Not really a kluge, loop on read 'till you get it all is kind of standard
> > for BSDish machines.  I went through this 10 years ago when I was working
> > on a multi-flavor network-parallel processing package.  I was going to
> > mention something up-thread but then I came to this post and figured the
> > problem was solved.
> I think I'd prefer it to loop through the select'd descriptors, retreive
> what's available into a buffer, then check to see if that completes a
> command. That strikes me as more robust, but it would require allocating
> a buffer for each pipe. It could turn out to be slower than reading twice.

I'm working on a patch that does just that.  It's done, but I'm still 
investigating why I can't just set the socket to non-blocking as soon as 
I create it.

> What I don't understand now is why it works presently, on any system.
> Since both writes and reads don't block, and can't lock, it's pure luck
> when a message gets through entire. Do linux users see "Resource
> temorarily unavailable", and "Module command is too big" errors in
> {.xsession, startx.log}? If not, why not? :)

AfterStep does non-blocking output with a buffer queue.  Prior to 1.7.55, 
AS used a pair of pipes inherited through fork() to talk to modules, and 
the read pipe was blocking and the write pipe was non-blocking.  This 
seems to work on *BSD.  In 1.7.55, this was switched to a UNIX domain 
named socket.  This has the advantage of not requiring AS to be the 
parent of the module process, but apparently the old method of reading 
from pipes no longer works.

I developed the new method of communication on linux, and have yet to 
have any problems with it that I've noticed.

I'm not sure if follow-ups can be redirected since the list munges the 
reply-to header, but I'll try to set the reply-to to the devel list.

Ethan Fischer