►
From YouTube: RustConf 2021 - Project Update: Libs Team by Mara Bos
Description
Project Update: Libs Team by Mara Bos
A story about how things get stuck, and how to get things moving again. Taking improvements to the standard library's locks as an example, we'll take a look at how large efforts often get stuck, and explore what can be done in such situations. We'll look into breaking problems apart, how to narrow the scope of discussions, and finally at some organisational changes that might help a bit.
A
A
A
But
luckily
operating
systems
already
shipped
with
an
implementation
of
these
on
linux,
mac
and
other
unixes,
that's
part
of
pthread,
which
is
part
of
supposed
standards
on
windows.
They
are
called
critical
sections
or
on
newer
versions
of
windows.
We
have
the
improved
srw
locks
or
slim
read,
write
logs.
A
A
That
means
an
object
cannot
assume
it
will
stay
at
the
same
memory
address
over
its
entire
lifetime.
These
lock
implementations,
however,
do
not
allow
their
objects
to
be
moved
here.
Is
the
documentation
of
srw
locks,
for
example,
and
it
clearly
states
an
srw
lock,
cannot
be
moved
or
copied
with
most
actual
implementations
today,
moving
would
actually
work
perfectly
fine,
but
their
specification
or
documentation
simply
doesn't
allow
it.
Future
implementations
might
work
differently,
so
we
have
to
follow
these
facts.
A
So
as
I
work
around,
we
allocate
them
on
the
heap.
We
put
them
in
a
box
that
way
if
you
move
the
rest,
mutex
object.
The
actual
underlying
system
detects
does
not
move
this
works,
but
it
is
inefficient
because
now
there's
allocations
and
interactions
involved
and
it
means
we
cannot
construct
these
objects
at
compile
time.
So
you
cannot
just
have
a
static.
Mutex
object
because
needs
to
be
allocated
at
runtime.
A
A
Let's
take
a
look
at
an
example:
we
have
a
mutex
protecting
some
integer
and
we
lock
it
and
then,
sometime
later
before,
unlocking
it,
we
try
locking
it
again
on
the
same
thread.
This
will
result
in
a
deadlock.
It
will
wait
forever
until
the
first
lock
is
released,
which
will
never
happen
because
we're
stuck
waiting.
A
If
you
relock
a
beta,
admit
x
on
the
same
thread,
the
behavior
is
undefined,
or
at
least
when
using
the
default
settings,
which
was
a
problem
in
older
versions
of
the
standard
library
and
critical
sections
on
windows
are
actually
re-entrant.
That
means
they
purposely
do
not
that
look
when
you
relock
them
on
the
same
track.
It
will
actually
succeed.
A
A
A
And
finally,
a
third
problem
in
rust,
leaking
or
forgetting
things
is
safe
by
definition
again,
usually
not
something
you
want,
but
perfectly
safe
an
example.
We
have
a
mutex,
we
lock
it
and
then
we
forget
that
we
locked
it.
It
never
gets
unlocked
again.
The
mutex
stays
locked
forever
later.
The
meter
gets
dropped,
while
it
is
still
locked.
A
A
A
A
A
That
means
they
can
be
constructed
at
compile
time,
so
you
can
have
them
a
static
variables
too,
that
locking
or
forgetting,
is
well
defined
and
there's
no
way
to
cause
and
define
behavior
with
them.
If
you
stick
to
the
safe
interface,
so
this
seems
like
the
solution
to
basically
everything
we
talked
about.
A
There
was
a
bit
of
discussion,
but
people
are
positive
and
not
much
later
on
a
cold
and
rainy
saturday
morning,
at
the
start
of
december,
linus
fernstant
opens
a
pull
request:
a
pull
request,
embedding
the
entire
parking
lot
crate
is
the
standard
library
and
changing
the
standard
library
to
use
it
for
synchronization
primitives
quickly.
Afterwards,
several
people
began
to
review
the
code
discussing
potential
issues.
A
A
The
standard
library
had
never
used
the
syscall
before,
and
some
questions
came
up
about,
whether
it's
okay
to
start
using
it,
which
versions
of
linux
support
it.
Is
it
maintainable?
Is
it
easy
enough
to
understand
this
wasn't
really
a
big
blocker,
but
it
wasn't
yet
another
topic.
On
top
of
the
already
large
amount
of
things
to
discuss
on
older
versions
of
windows
where
necessary,
where
the
necessary
functionality
wasn't
available,
it
used
something
called
anti-keyed
events
which
are
undocumented.
A
A
A
The
author
and
other
people
had
tirelessly
worked
on
addressing
all
the
comments
and
issues
and
a
lot
of
progress
was
made,
but
after
all
this
time,
activity
on
the
threat
was
rapidly
slowing
down
by
the
time
yet
another
year
it
started.
There
were
just
a
few
more
comments
until
eventually
everyone
just
ran
out
of
energy.
A
A
A
A
What's
happening
now
is
a
weird
kind
of
deadlock
in
the
progress
towards
better
mood
taxes,
a
kind
of
deadlock
that
happened
surprisingly
often
in
the
rust
project-
and
I
bet
in
many
other
projects
as
well
what's
happening
now.
Is
that
every
time
that
someone
brings
up
some
small
problem
or
some
improvement
to
the
current
logs
people
reply
with
oh,
but
parking
lot
is
going
to
solve
this.
A
It
makes
changes
to
the
existing
logs
very
low
priority,
because
people
are
still
expecting
parking
lot.
Integration
to
happen
sometime
soon,
people
are
hopeful,
but
at
the
same
time,
if
someone
then
asks
what's
happening
with
parking
lots,
when
is
it
going
to
be
integrated
and
what
needs
to
happen?
A
A
A
A
As
for
recognizing
this,
I
I
hope
this
talk
will
help
a
bit
for
handling
them.
That's
a
lot
harder,
but
I
have
some
ideas.
Let's
start
small
chapter
4
tiny
steps,
instead
of
trying
to
gather
all
the
contexts
and
reconstruct
the
entire
web
of
all
the
different
issues
that
were
involved,
you
can
take
a
look
at
one
single
obstacle
at
a
time
pick
the
tiniest
obstacle
you
can
find
and
try
to
move
it
out
of
the
way,
try
to
find
a
way
to
fix
it
in
a
way
that
does
not
touch
any
other
parts.
A
A
Obstacle,
1
stability
guarantees
the
standard
library.
Documentation,
makes
a
lot
of
promises
which
we
usually
never
try
to
break.
That's
part
of
our
stability
guarantee.
A
There's
one
small
promise
about
mute
taxes,
however,
that
we
would
not
be
able
to
keep
if
we
switch
to
a
more
efficient
implementation,
whether
that's
parking
lot
or
something
else,
I'm
not
going
into
much
detail
now,
but
we
basically
promise
to
panic
in
certain
situations
with
newer,
mutex
implementations.
We
can
no
longer
always
give
that
panic
in
those
situations.
A
It's
not
a
big
deal
because,
instead
of
panicking,
it
will
just
work
and
it's
very
unlikely
that
someone
actually
relied
on
this
panic
happening.
In
fact
when
it
was
brought
up
during
the
original
big
parking
lot
integration.
Pr,
the
reviewers
seemed
fine
with
this
change,
but
it
will
be
something
that
will
be
brought
up
next
time.
Digging
up
the
old
discussion
then,
would
help,
but
it
will
still
be
a
distraction.
A
So
I
worked
on
making
it
possible
to
make
this
decision
for
each
platform
individually
to
make
it
possible
for
potential
future
improvements
to
be
made
per
platform,
allowing
for
smaller
changes
to
have
a
reason
to
do
so.
I
looked
for
a
first
platform
to
unbox
the
mutexes
on
to
no
longer
put
them
on
the
heap.
A
A
A
And,
to
my
surprise,
just
a
few
days
later,
it
was
actually
reviewed
and
merged,
and
now
it's
part
of
the
official
documentation,
I'm
not
entirely
sure
what
I
expected,
but
I
did
not
think
it
was
going
to
be
this
easy
anyway.
Now
that
we
now,
we
actually
certainly
have
a
platform,
a
very
big
one,
with
movable
mutexes.
A
I
have
not
been
able
to
benchmark
it,
as
I
don't
have
a
windows
computer
to
test
it
on,
but
I'm
assuming
it
made
a
noticeable
difference
to
the
speed
of
the
rust
mutaxes
on
windows,
at
least
in
the
very
contented
cases
anyway.
Now
that
it's
merged.
That
means
that
next
time
we
want
to
unbox
the
mutex
on
another
platform,
it's
just
a
flip
of
a
switch
so
obstacle
2
removed.
A
A
Neither
of
these
had
been
used
in
standard
library
before
a
point
of
discussion
that
came
up
in
the
parking
lot.
Pull
request
is
whether
we
are
okay
with
using
them,
because
we
have
no
experience
with
them
yet
so
I
figured
if
we
can
just
use
these
apis
in
another
place
in
the
standard
library.
In
a
more
isolated,
simple
case,
we
can
get
this
obstacle
out
of
the
way.
A
Since
they're
so
useful
for
threat
parking,
I
figured
we
can
just
implement
the
standard
library
spark
and
unpark
functions
with
it.
These
functions
are
not
used
much
and
they
are
more
primitive
than
what
a
parking
lot
provides,
but
they
are
there
and
pretty
simple
to
implement
with
these
os
primitives
without
touching
any
other
code.
A
A
A
A
A
So
now
we
actually
do
have
a
team
to
handle
library,
mcps
and
more
and
now
the
api
team
can
guard
stability
and
work
on
api
design
without
getting
distracted
by
implementation.
Details
we're
still
figuring
out
the
best
way
to
do
things
and
what
our
responsibilities
should
be.
But
so
far
things
are
going
pretty.
Okay,.
A
A
A
We
should
guide
them
towards
things
that
we
can
actually
say
yes
to.
We
should
recognize
if
things
can
be
split
into
smaller
parts
and
we
should
try
to
clean
up
after
failed
attempts
make
sure
that
context
does
not
get
lost
over
time.
We
should
recognize
when
something
is
blocked
on
something
and
figure
out
how
to
unblock
it.