[dylan] stream locking: opt-in or opt-out?

Bruce Mitchener <[email protected]> Thu, 1 Aug 2013 10:39:08 +0700
Newsgroups gmane.comp.lang.dylan.gwydion.devel
Message-ID <CA+esKjMrWa=+kHHRJi9By=Pk_PPP4W3r4Pq84OvHpUZFUYBaWg@mail.gmail.com>
Currently, all streams default to having a lock and requiring that people
opt out of being locked:

  slot private-stream-lock-value :: false-or(<lock>) =
make(<recursive-lock>),
    init-keyword: stream-lock:;

I think there is a reasonable case to be made that streams could or should
default to being unlocked and allow people who know they need locking to
opt into locking and give them an appropriate lock (or make the
init-keyword be locked?: and use that to set the stream-lock).

Obviously, some streams should be locked by default, like the standard-io
streams for stdin, stdout, stderr.

Short of that, we could do something like defaulting all string-streams to
be unlocked, but that seems more confusing to document to me.

What do other people think?

 - Bruce

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