Re: [dylan] Stream locking (was: Method combinations as a design pattern for locking)

Bruce Mitchener <[email protected]> Fri, 20 Dec 2013 13:50:29 +0700
Newsgroups gmane.comp.lang.dylan.gwydion.devel
Message-ID <CA+esKjN=PJwaCNCYF--WZUrZciwAf3+gjD8Fy3dFYWWts8WocQ@mail.gmail.com>
On Thu, Dec 19, 2013 at 3:52 PM, Bruce Mitchener
<[email protected]>wrote:

> I've updated my branch after a couple of comments from housel.
>
> I've also updated it to remove 2 more instances of with-stream-locked (one
> in format(), one in print()). It also now includes documentation for
> lock-stream, unlock-stream and with-stream-locked which were previously
> undocumented.
>
> I re-did a 3 stage bootstrap today without problems. After that, I re-ran
> the test from bug 4004 from 1998. I noticed an interesting change.
> Yesterday, when I ran it, the behavior was somewhat chaotic in that each
> thread would print out some varying number of lines before the switch to
> the other thread. Today, they interleave perfectly fine, printing one item
> from each one thread and then the other.  That seems like a pretty good
> improvement to me in the threading behavior.
>
> Also, at the prompting of housel, I've sealed the lock-stream and
> unlock-stream generic functions on a couple of classes where that was
> possible to help eliminate some dispatch overhead where possible. This was
> the case for <byte-string-stream>, <unicode-string-stream> and
> <simple-wrapper-stream>.
>
> Thanks to everyone who's helped this come together and provided
> encouragement. This is looking like a good set of changes and improvements.
>

This branch has landed on master today. Thanks to housel for the review and
merge.

If Hannes or Bruce Hoult would like to do additional work to add some
safety features to detect using unlocked streams across threads, that'd be
interesting to see.

 - Bruce

_______________________________________________
hackers mailing list
[email protected]
https://lists.opendylan.org/mailman/listinfo/hackers