Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 May 1996 15:10:08 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        stevenf@thetics.europa.com (Steven Frank)
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: Socket library question
Message-ID:  <199605212210.PAA02223@phaeton.artisoft.com>
In-Reply-To: <Pine.SUN.3.91.960521105823.5950A-100000@thetics.europa.com> from "Steven Frank" at May 21, 96 11:10:10 am

next in thread | previous in thread | raw e-mail | index | archive | help
>     I have ported the BSD socket library to another OS, and added an 
> integrated PPP interface and modem dialer.  The ultimate goal is a 
> Trumpet WinSock-ish type of application.

Which OS?

>     It all seems to be working well except for one thing.  When a client 
> application calls recv(), and the recv() cannot be fulfilled immediately, 
> the kernel calls sbwait() which in turn calls tsleep().  Somehow the 
> appropriate wakeup is not happening and it stays in tsleep() 
> indefinitely.  

If this is Win95 we're talking about here, then you probably implemented
these with the Win95 semaphore calls?

You should be aware of two things:

1)	When an event to be processed comes in, it can be run on
	any blocking thread.

2)	The semaphores are not good for blocking self reeentrancy.

Effectively, this means Win95 can reentry your code with any async
event and you are powerless to stop it, unless you implement a
counting semaphore on top of their thread semaphores.

This became obvious when running updated in UFS implemented on
Windows95; I can't claim credit for the kill.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199605212210.PAA02223>