Re: Bug with cocoa

Gary Byers <[email protected]> Sat, 11 Oct 2003 01:21:47 -0600 (MDT)
Newsgroups gmane.lisp.openmcl.bugs
Message-ID <[email protected]>

On Sat, 11 Oct 2003, Raffael Cavallaro wrote:

> The following code runs fine from the command line version of OpenMCL
> (i.e., dppccl). Apologies for any hackishness - it's a simple benchmark
> of format:
>
> (defun hanoi (x)
>    "Prints the solution to the Towers of Hanoi puzze for x disks to std
> output."
>
> When I execute (hanoi 9) from the command line version of OpenMCL,
> everything runs fine. However, if I execute (require 'cocoa) and the
> OpenMCL IDE launches, I can compile hanoi, but (hanoi 9) chokes,
> usually halfway through a line of output. I get the dread spinning
> beachball/optical-disk-of-death, and I must force quite OpenMCL. Again,
> this works just fine from the command line, and in MCL 5.0 as well,
> (and sbcl too, fwiw). It would seem to be a problem with the cocoa
> implemetation of format to standard output.
>
>   I'm running OpenMCL Version (Alpha: Darwin) 0.14-030901.
>
> regards,
> Raf
>
>
> Raffael Cavallaro, Ph.D.
> [email protected]

I -think- that this is a known bug: the main Cocoa event thread is
periodically interrupting itself and forcing output to "interactive"
streams (i.e., listeners.)  The device used by Cocoa listener streams
has a tiny kernel I/O buffer, so the writes initiated by FORCE-OUTPUT
sometimes block until the other end of the connection reads pending
data.  Unfortunately, "the other end of the connection" in ths case
is the main Cocaa event thread, which would receive a pending data
notification if it wasn't so busy waiting for the write to complete ...

I hope to have new binaries available this weekend.  Having another
thread handle periodic activities like this seems to make the problem
go away.