Date: Thu, 18 Sep 2003 06:55:11 +0200 (CEST) From: Barry Bouwsma <freebsd-misuser@remove-NOSPAM-to-reply.NOSPAM.dyndns.dk> To: FreeBSD List of Hackers <hackers@freebsd.org> Subject: Re: Machine wedges solid after one serial-port source-line addition... Message-ID: <200309180455.h8I4tBK58276@Mail.NOSPAM.DynDNS.dK> References: <200309152127.h8FLRrv71220@Mail.NOSPAM.DynDNS.dK> <3F66DFED.C3FA43EE@mindspring.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[Ooops, looks like I sent out two mails to this list with the wrong address, so most of your anti-spam filters probably bitbucketed them where they belong. Fixed, I hope, with an IPv6-only address. But just reply to the list and drop me, I'll catch up from the archives... ] Terry Lambert wrote: > > Would anyone care to explain why the following simple patch could be > > enough to wedge my machine solid? (My original hack-patches without > You are calling printf() from a fast interrupt handler. I had a feeling it might be something like that. In truth, I had experienced a repeatable machine hang *without* the printf() that either happened immediately or after some hours -- I can't remember which now -- and tried to simplify my code down to something simpler using printf()... > If you need to communicate information to a console log (or > wherever), then you should enqueue the information on the > status change, and wake up some thread to do the actual Well, I only wanted the printf() to verify that that part of the code was being hit as expected, for debugging. My original code was calling wakeup(). You see, what I'm attempting to do, without knowing what I'm doing, is to implement the TIOCMIWAIT ioctl that apparently exists in Linux, to notify a userland program that there's been a status change on one or more of the modem status lines, and eliminate the need to poll the status line in question, cutting that program's cost to run by a factor of about 20 in the testing I did before the machine would wedge. I did all this offline, with no examples to follow, but now I have something to look at and see if I have the general idea. So I should probably shut up and study it. So, since a printf() is right out, is it safe for me (as a non- programmer, so forgive my ignorance of the basics) to simply use little more than a wakeup() in its place? Or does that, or the tsleep() corresponding, need some sort of careful handling to avoid the lockups I've experienced? Thanks, Barry Bouwsma
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309180455.h8I4tBK58276>