Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 1998 12:35:17 +0100
From:      james.g.mansion@hsbcgroup.com
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: Thread Problems
Message-ID:  <8025667B.003F044A.00@hbmdtesmtp1.tex.hsbcmidland.com>

next in thread | raw e-mail | index | archive | help
The latest edition of Stevens Network Programming has a discussion on this
point.

The accept should not be done in blocking mode, for exactly the reason
suggested below.

See; UNIX Network Programming 2ed, , W Richard Stevens, Prentice Hall
International, ISBN 0-13-490012-X

 The discussion in S15.6,'Nonblocking accept', is pertinent.

James





Daniel Eischen <eischen@vigrid.com> on 10/09/98 11:40:39

To:   eischen@vigrid.com, tlambert@primenet.com
cc:   freebsd-current@FreeBSD.ORG, info@highwind.com (bcc: James G
      MANSION/HBMD/HSBCMERIDIAN)
Subject:  Re: Thread Problems




> > I tried to repeat the reported problem, but couldn't.  I had
> > one thread listening for client connections, a worker thread
> > (printing a message once a second), and main.  The thread
> > listening for client connections would create a thread to
> > handle the connection and go back to accepting more connections.
> > I couldn't make it fail - the worker thread was always spewing
> > out messages once a second.  I even tried using fork to
> > process each client request that came in - that worked also.
>
> We really need to get more information.
>
> Effectively, we have the select coming true before the accept call,
> followed by the accept call blocking, even though the select was
> true.
>
> In theory, this can't happen, even with a blocking fd.
Actually, I think this can happen.  We were able to reproduce
this (under HP-UX, didn't try FreeBSD) but I forget the exact
circumstances.  I think it had something to do when the remote
client attempted to make a connection but closed the socket
before the connection was complete.  I'll have to see if I
can find it in my notes - it was 3 or 4 years ago...
> This has got to be a code specific problem.  Perhaps they made the
> mistake of the LDAP implementors about number of descriptors, or
> the meaning of "preemptive", and are engaged in a buzz-loop.  8-(.
>
> I just assumed that the person was running -current, and was seeing
> what he thought he was seeing; on the other hand...
I think he was running current - don't know how recent it was
though.
> It would be interesting to know what *exact* version of FreeBSD he
> was running, as well.
>
> Also, if this is a Linux program running under emulation, it should
> not be expected to work...
No, I remember it being code they were porting to FreeBSD.
Dan Eischen
eischen@vigrid.com
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message
**********************************************************************
This message originated from the Internet. Its originator may, or may
not be who they claim to be, and the information contained herein
may, or may not be accurate.
**********************************************************************






************************************************************************
Midland Bank plc, who is regulated in the UK by SFA, has issued the
information contained in this message (including any attached documents)
for its non-private customers only. It should not be reproduced and/or
distributed to any other person. It is not an invitation to buy or sell
securities. Opinions may change without notice and members of the 
HSBC Group may have positions in, or trade in instruments mentioned in
this message. Each page attached hereto must also be read in conjunction
with any disclaimer which form part of it.
************************************************************************


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8025667B.003F044A.00>