[Openmcl-devel] bogus objects
ch-openmcl at bobobeach.com
Sat Nov 13 21:24:57 PST 2004
On Nov 13, 2004, at 6:51 PM, Gary Byers wrote:
> In the current case using a string stream incidentally (for (FORMAT
> NIL ...))
> means that you cons up a stream object and a string or two that may
> become garbage. I don't think that adding a lock to each string stream
> is desirable (the OS would have to be involved in the creation and
> destruction of that lock), though it may be possible to defer the OS's
> involvement to the (hopefully rare) case where there's some actual
> contention involved. I'd have to think about that a bit more.
> If the shared string-output-streams that Araneida creates are basically
> "permanent", it might be practical to:
> a) create a corresponding lock for each global shared string stream
> b) ensure that any code which accesses such a shared stream grabs
> the corresponding lock before doing so.
using ccl::make-lock and ccl::with-lock-grabbed seem to have
ameliorated the problem. I'm not convinced there aren't more gotchas
lurking, but I think the one I was seeing was due to multiple threads
trying to write to a global error stream at roughly the same time.
> If that -is- practical, I suspect that you'll see the memory corruption
> go away. (I'm relieved that this doesn't seem to be a GC problem.)
> If it isn't practical, please let me know and I'll try to talk to
> Dan Barlow about it
I'm pretty new to all this CL threading stuff. It would be great if
there were a portable way to do this kind of locking.
Any nice tools for checking memory integrity I should know about?
More information about the Openmcl-devel