🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #392

Re: usleep and efficiency

#392
From: moose
Date: Fri, 31 Jul 1992 17:51
24 lines
1436 bytes
In article <2A778A16.26787@noiro.acs.uci.edu> rmyers@dec5200.acs.uci.edu  
(Richard Myers) writes:
> 2 questions
> 1. Why does a simple usleep(100000); *HANG* my app?
> 	Background: The program does a DPSTimedEntry.  Do these conflict?
> 	  also, it only hangs when I have the sound turned on for the app.
> 	  also, it doesn't COMPLETELY hang.  If I'm running from a shell,
> 	  I can send a ^C and it'll continue. (Yes, I'm pretty sure it's
> 	  the usleep from gdb.  No, it's not consistent (takes variable #
> 	  of usleeps to hang))
> 

Because DPSTimedEntry uses threads, and threads and signals get along about as  
well as any two middle eastern nations, you should not do this.  However, there  
is a wonderful example which uses mach ports timing out to implement a  
non-signal dependant sleep.  I forget where, but it's in  
NeXTDevelopers/Examples.


--
Michael Rutman			|	moose@svcdudes.com
Cubist				|	makes me a NeXT programmer
Software Ventures		|	maker of MicroPhone II
#include <std.disclaimer>
Technical Details
Message-ID: <1992Jul31.175146.23460@svcdudes.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!svc!news
References: <2A778A16.26787@noiro.acs.uci.edu>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!psinntp!svc!news
From: moose@svcdudes.com
Subject: Re: usleep and efficiency
Message-ID: <1992Jul31.175146.23460@svcdudes.com>
Sender: news@svcdudes.com
Reply-To: moose@svcdudes.com
Organization: Software Ventures, Inc.
References: <2A778A16.26787@noiro.acs.uci.edu>
Distribution: na
Date: Fri, 31 Jul 92 17:51:46 GMT
Lines: 24