<!DOCTYPE html>
<!-- BaNnErBlUrFlE-BoDy-start -->
<!-- Preheader Text : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">
On 23/02/2026 14: 18, Michael Stover wrote: > Secondly, the propagation of ScopedValues in StructuredConcurrency is > nice, but it's limited to simply copying the reference to the > ScopedValue to all the sub-threads. For some purposes,</div>
<!-- Preheader Text : END -->
<!-- Email Banner : BEGIN -->
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerStart</div>
<!--[if ((ie)|(mso))]>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="padding: 0px 0px 10px 0px; direction: ltr" lang="en"><tr><td>
<table border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 6px 8px; width: 100%; border-radius:4px; border-top:4px solid #8193a0;background-color:#60beeb;"><tr><td valign="top">
<table align="left" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 8px 4px 8px; font-size: 12px; line-height: 16px">
<tr><td style="color:#000000; font-family: 'Arial', sans-serif; font-weight:bold; font-size:14px; line-height: 20px; direction: ltr">
This Message Is From an External Sender
</td></tr>
<tr><td style="color:#000000; font-weight:normal; font-family: 'Arial', sans-serif; font-size:12px; direction: ltr">
This message came from outside your organization.
</td></tr>
</table>
<![if ie]><br clear="all"><![endif]>
<table align="right" border="0" cellspacing="0" cellpadding="0" style="padding: 0px 0px 4px 0px; font-size: 14px; line-height: 36px"><tr>
<td style="direction: ltr"> <a target="_blank" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!ND269knO22lk39Pql5P-GDi8vs6IUHEMEXUs7bvAIRgi2ZQfFMa6pe9gGJaluIOMe5QVVsadxSe5wsnpWbPt6mrSy8mu2k0sNT-U$" style="mso-padding-alt: 7px; padding: 7px; border-radius: 2px; border: 1px solid #666666; "><strong style="font-weight: normal; color: #000000; text-decoration: none; font-family: 'Arial', sans-serif; font-size: 14px;"> Report Suspicious </strong></a> </td>
</tr></table>
</td></tr></table>
</td></tr></table>
<![endif]-->
<![if !((ie)|(mso))]>
<div dir="ltr" lang="en" id="pfptBannerduuuykg" style="all: revert !important; display:block !important; text-align: left !important; margin: 0 0 10px 0 !important; padding:7px 16px 8px 16px !important; border-radius: 4px !important; min-width: 200px !important; background-color: #60beeb !important; background-color: #60beeb; border-top: 4px solid #8193a0 !important; border-top: 4px solid #8193a0;">
<div id="pfptBannerduuuykg" style="all: unset !important; float:left !important; display:block !important; margin: 1px 0 1px 0 !important; max-width: 600px !important;">
<div id="pfptBannerduuuykg" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-weight:bold !important; font-weight:bold; font-size:14px !important; line-height:1.29 !important; line-height:1.29">
This Message Is From an External Sender
</div>
<div id="pfptBannerduuuykg" style="all: unset !important; display:block !important; visibility: visible !important; background-color: #60beeb !important; color:#000000 !important; color:#000000; font-weight:normal; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size:12px !important; line-height:1.5 !important; line-height:1.5; margin-top:2px !important;">
This message came from outside your organization.
</div>
</div>
<div id="pfptBannerduuuykg" style="all: unset !important; float: right !important; display: block !important; display: block; margin-left: 16px !important; margin-top: 1px !important; text-align: right !important; width: fit-content !important; font-size: 12px !important">
<a id="pfptBannerduuuykg" href="https://us-phishalarm-ewt.proofpoint.com/EWT/v1/ACWV5N9M2RV99hQ!ND269knO22lk39Pql5P-GDi8vs6IUHEMEXUs7bvAIRgi2ZQfFMa6pe9gGJaluIOMe5QVVsadxSe5wsnpWbPt6mrSy8mu2k0sNT-U$"
style="all: unset !important; display: inline-block !important; text-decoration: none">
<div class="pfptPrimaryButtonduuuykg" style="display: inline-block !important; display: inline-block; visibility: visible !important; opacity: 1 !important; color: #000000 !important; color: #000000; font-family: 'Arial', sans-serif !important; font-family: 'Arial', sans-serif; font-size: 14px !important; font-weight: normal !important; text-decoration: none !important; border-radius: 2px !important; margin-top: 3px !important; margin-bottom: 3px !important; margin-left: 16px !important; padding: 7.5px 16px !important; white-space: nowrap !important; width: fit-content !important;
border: 1px solid #666666">
Report Suspicious
</div>
</a>
</div>
<div style="clear: both !important; display: block !important; visibility: hidden !important; line-height: 0 !important; font-size: 0.01px !important; height: 0px"> </div>
</div>
<![endif]>
<div style="display:none !important;display:none;visibility:hidden;mso-hide:all;font-size:1px;color:#ffffff;line-height:1px;max-height:0px;opacity:0;overflow:hidden;">ZjQcmQRYFpfptBannerEnd</div>
<!-- Email Banner : END -->
<!-- BaNnErBlUrFlE-BoDy-end -->
<html>
<head><!-- BaNnErBlUrFlE-HeAdEr-start -->
<style>
#pfptBannerduuuykg { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important;
background-color: #60beeb !important;
max-width: none !important; max-height: none !important }
.pfptPrimaryButtonduuuykg:hover, .pfptPrimaryButtonduuuykg:focus {
background-color: #77a8c4 !important; }
.pfptPrimaryButtonduuuykg:active {
background-color: #8193a0 !important; }
html:root, html:root>body { all: revert !important; display: block !important;
visibility: visible !important; opacity: 1 !important; }
</style>
<!-- BaNnErBlUrFlE-HeAdEr-end -->
</head><body><pre style="font-family: sans-serif; font-size: 100%; white-space: pre-wrap; word-wrap: break-word">On 23/02/2026 14:18, Michael Stover wrote:
> Secondly, the propagation of ScopedValues in StructuredConcurrency is
> nice, but it's limited to simply copying the reference to the
> ScopedValue to all the sub-threads. For some purposes, that works fine,
> but there are surely cases where what we'd want is a child context
> created, probably from the parent.
By design, no copying takes place. The set of scoped value bindings is
made visible to the child. That set is immutable: nothing in it can be
altered, and nothing can be removed. When a child thread is started
there is no opportunity to inspect the inherited bindings to determine
any properties. All a child can do is create a superset of the parent's
bindings by adding bindings of its own.
> If the propagation routine could discover that a ScopedValue would
> prefer to create a child scoped value rather than just copying the
> parent scoped value to all sub-threads, then when creating a ScopedValue
> we could control how it propagates. If the ScopedValue implemented an
> interface such as "PropagatingScopedValue" or whatever, then it could
> have the opportunity to create it's child object for each sub-thread.
The ScopedValue API is deliberately simple, in order to have a small API
surface and to impose as little as possible runtime overhead on simple
usage patterns.
We didn't implement a non-inheritable scoped value because that's fairly
simple to do in user code.
public class MyKindOfScopedValue<T> {
private final ScopedValue<ValueHolder<T> > handle;
public MyKindOfScopedValue() {
handle = ScopedValue.newInstance();
}
public void runWith(T t, Runnable op) {
where(value, new ValueHolder(t)).run(op);
}
public T get() {
return handle.get().get();
}
... etc
}
class ValueHolder<T> {
private final Thread owner;
private final T value;
T get() {
if (owner == Thread.currentThread()) {
return value;
} else {
... something local here;
}
}
ValueHolder(T value) {
owner = Thread.currentThread();
this.value = value;
}
... etc
}
</pre></body></html>