►
From YouTube: Node.js N-API Team meeting - Sep 16 2019
Description
A
A
Right
so
this
one
I
typed,
so
there
was
basically
this
is
some
discussion
and
note
on
API
about
using
C
make
and
I.
Remember
Jim.
You
mentioned
that
you
done
some
work
to
help
on
that
front.
But
I
didn't
remember
the
detail,
so
we've
been
kind
of
deferring
until
you
were
back
to
bring
us
a
date
and
I
will.
B
A
A
D
C
D
C
D
A
D
D
A
H
G
G
G
G
A
G
A
G
A
A
B
A
D
B
C
A
C
I
B
D
D
A
D
D
D
B
G
I
I
also
I
also
think.
Yes,
there,
it
hasn't
changed
in.
It
hasn't
changed
since
we
introduced
an
API,
so
I
mean
yeah,
like
our
modules
purchase.
Six
modules
should
still
load,
but
we
do
we
do.
We
should
sort
of
have
some
testing
about
that.
You
know
like
where
you
like,
build
the
build
like
the
the
tests
on
one
version
of
node,
and
then
you
run
it
from
another
version
of
node
without
rebuilding.
We
should
really
have
that,
but
it's
a
huge
yeah.
A
D
A
But
I
think
I
think
the
answer
is,
it
needs
to
be
right
because
otherwise
it
yeah
like
they
don't
want
to
use
nappy
module
or
nappy
module
axe
right,
but
I
think
that
the
reality
is
that
the
C
function,
which
does
the
register,
is
what
we
actually
export.
G
Well,
no
nappy
want
to
register
is
a
function
that
needs
to
be
called
from
the
from
the
library
constructor
to
register
module
and
there's
actually
there's
actually
an
alternative
module
registration
process
which
which
we
introduced.
You
know
by
a
while
back
with
with
Ben,
and
that's
you
have
like
a
special
symbol.
So
so
you
have
like
nappy,
underscore
registered
module
underscore
one
and
then
that's
it's
like
nappy
wanted
to
version
one,
and
so
it
looks
for
that
special
symbol
and
and
implants
it
so,
and
that
also
allows
for
registration.
Well,
I
know
that.
G
Meanwhile,
meanwhile,
we
have
multiple
registration,
even
first
structure
based
modules,
but
but
they're
cleanest,
the
cleanest
way
to
load.
The
module
is
to
just
define
that
special
symbol
would
not
be
module
export
and
that's
what
mapping
module
in
it
does
for
you.
If
you
use
nothing
module,
it
doesn't
create
any
structure,
it
just
creates
the
special
symbol
and
it
allows
you
to
do
in
the
body
of
what
what
you
do
so
so
now
I
think
that'd
be
module.
G
Images
is
the
safest
way
to
go
home,
because
all
it
does
is
declare
are
a
symbol
that
has
a
certain
name,
and
that
name
is
a
bi-stable
in
the
sense
that
it
will
only
become
incompatible.
If
ever
would
define
like
a
conversion
to
of
an
anything
I
want
you
and,
and
even
then
you
know
we
can
fall
back.
So
we
can,
we
can
do
mitigation,
but
for
now
we
don't
have
any
such
need
right.
A
A
G
G
D
D
G
So
basically,
so
you
have
like
you
you,
you
declare
that
function
at
B
register,
module,
b1
and
then
a
bracket
nappy
and
and
come
on
happy
value.
Exports!
That's
it
that's!
All
you
have
to
do
is
just
declare
that
function
and
you're
done
and
and
that
function
will
be
called
multiple
times
from
multiple
threads.
However
many
worker
threads
you
have,
although
all
the
benefits
and
restrictions
of
having
like
context
to
where
modules
of
eyes
and
that's
it.
G
G
No
okay,
we
don't
have
it
in
in,
we
don't
have
it
in
a,
but
we
have
it
in
ten,
so
I
miss
TV
products
staging
as
RC
node.
If
the
ICC
or
not
no.
G
Yeah,
on
version
eight,
okay,
yeah
I,
don't
believe
it
falls
back
to
the
special
symbol.
Okay,
so
we
don't
have
the
special
symbol
support
on
eight,
but
we
do
have
it
on
10
and
12,
and
everyone
beyond
that
right.
So
that's
that's
the
situation,
so
yeah
I
mean
the
structure.
The
structure
is
definitely
a
a
bi-stable
if
they
want
to
go
with
the
structure
and
the
special
symbol
is
also
a
bi-stable
and
it
goes
back
to
version
10,
so
it's
up
to
them,
which
one
they
want
to
use.
G
Thank
you,
I
would
prefer
I
would
prefer
the
the
special
symbol,
because
that's
more
it's
much
simpler
and
they're,
not
relying
on
any
structure.
Symbols
are
very
unlikely
to
change
less
likely
than
structures.
So
you
know
what
Persians
denote
they
wish
to
support,
but
those
are
their
options
right.
A
A
G
There's
our
oh
there's
a
kite
I
think
somewhere.
Where
did
we
put
that
I
mean
like
the
stuff
that
I
mentioned
in
my
blog
post,
a
test?
That's
what
I'm
talking
about
here.
G
A
A
G
It's
actually
the
other
way
around
right,
like
you
need
to.
You
need
to
create
the
structure.
You
need
to
create
the
structure
like
global
static,
and
then
you
need
you
need
to
create
a
library,
constructor
and
inside
the
library
constructor.
You
call
Navi
module
register
and
your
asset
structure
right.
So.
D
G
A
A
A
G
D
A
A
G
G
G
Just
gonna
say
we
have
some
leeway
in
the
structure
because
we
do
have
the
versioning
and
there
and
we
do
reserved
words
there.
So
we
can
go
within
the
structure
without
having
to
add
a
symbol
but
yeah.
We
could
just
add
another
symbol,
and
at
that
point
you
would.
It
would
just
be
the
same
as
as
as.
G
Jerry
script.js
group
doesn't
have
library
constructors
by
default,
you
right
it
actually
needed
to
be
implemented
as
a
feature
of
the
of
the
bare-bones
C
library
that
they
were
using,
whereas
whereas
exporting
symbols
is
sort
of
a
universal
concept
on
all
platforms,
so
that's
the
very
reason
you
wanna
go.
Would
you
reach
a
wider
audience
with
your
codebase
in
terms
of
different
platforms
and
and
binary
environments?
D
D
D
G
A
B
C
A
A
A
I
Yes,
so
last
week
what
we
had
sort
of
discussed
is
we
can
change
the
unique
pointer
just
to
be
a
standard
pointer,
but
then
we
also
said
that
when
we
were
to
make
a
copy
that
we
wanted
to
apply
on
copy
and
release
on
destruct.
But
what
I
was
sort
of
thinking
is
that
we
don't
know
I
feel
that
we
don't
necessarily
need
to
implement
that
logic,
because
I
feel
that
well
I
think.
I
A
I
think
I'll,
try
and
remember,
like
I
I,
think
we
thought.
The
case
was,
though,
that
if
you
were
like,
we
rely
on
the
like,
if
you've
got
an
instance
of
a
class
until
your
until
your
class
has
either
called
a
particular
method,
it
doesn't
free
that,
like
it
doesn't
free
the
the
the
reference
count
in
any
P
in
the
MA
API
side,
but
that
if,
if
we
didn't
bump
the
reference
counter
before
the
copy,
we
would
potentially
have
a
race
condition
where
that
could
get
fired.
A
A
Don't
think
that
can
happen
on
its
cuz
like
it's,
because
the
class
ends
up
listening
on
something
right
and
it
gets
I
forget
what
I
think
Gabriel
there's
some
sort
of
notification
like
either
you
either.
You
call
something
saying:
I
no
longer
need
this
copy
or
you
call
something,
and
it
tells
you
that
sorry,
it's
closing,
but
by
the
very
fact
of
having
called
it.
It
now
know
in
now,
decrements
the
reference
count
says:
okay,
well,
you
know
so
don't
use
it
again
right.
A
A
A
As
soon
as
you
as
soon
as
you
get,
that
closing
does
that
order
also
you're,
not
you're
right
you're,
not
to
call
it
again,
but
is:
does
that
mean
that
internally,
it's
also
basically
said:
okay,
I'm
decrementing,
the
reference
count
because
you've
been
notified,
correct
right.
So
if,
if
you,
if
that.
I
G
Yeah
yeah,
basically
yeah
it
may
fail
to
construct.
That's
true
yeah
it.
Let's
say
it's
like
one
thread
is
in
the
middle
of
the
copy.
Constructor
and
the
other
thread
gets
a
nappy.
Closing
now
threat
would
call
acquire
and
it
would
be
calling
a
flier
on
a
flex,
a
function
which
everybody
has
already
released
and
therefore
it
is
not
muted
but
yeah.
G
I
G
Exactly
it's
the
same
mistake
that
you
would
be
committing
when
using
the
TS
FN
directly
without
any
wrapper
and
calling
a
choir
on
it
after
everybody
has
already
called
police
so
right.
So
that
is
a
possible
coding
mistake
and,
and
using
the
wrapper
doesn't
make
it
any
less
of
a
coding
mistake.
It's
still
a
coding
mistake
only
in
the
case
of
the
wrapper,
it
manifests
itself
as
a
copy
constructor
after
the
last
release
and
in
plane,
C
manifests
itself
as
a
call
to
acquire
after
the
last
release.
I
G
I
G
G
E
I
I
So
we
sort
of
do
this
check
that
the
wrapper
class,
if
it
already
holds
a
thread-safe
function,
that's
still
alive.
We
throw
this
error
here,
but
I
feel
that
if
you
were
not
using
the
wrapper-
and
you
tried
to
call
nappy
Creek,
that's
a
function
twice
pointing
to
the
same
output,
nappy
threats,
a
function,
you
would
stick,
wouldn't
error,
would
it
it
would
just
you
would
just
create
a
new
thread
safe
function.
The
previous
one
would
just
be
lost
right
right.
A
G
Yeah
can
add
some
value,
but
then,
but
then
you
had,
but
then
we
need.
We
need
a
unique
pointer,
because
because
then,
then
that
makes
the
pointer
that
holds
the
thread.
Safe
function
itself
thread
safe
right,
because
you
know
what,
if
you,
you
know
well
what
if
you
have
like
a
another
thread.
But
what?
G
If
the
stress
a
function
is
about
to
be
permanently
released,
right,
everybody's
called
release
and
about
be
said
to
no
rights
on
the
different
thread
holding
it
like
this,
you
know
in
a
unique
pointer
was
supposed
to
prevent,
prevent
it
from
from
from
from
doing
the
off
nominal
thing,
which
is
to
you
know,
to
error
when
in
fact
the
thread
safe
function
was
supposed
to
be
empty,
it's
just
it
hasn't
reached
the
thread.
Yet
the
information
that
it
is
now
found.
That's
right.
G
It's
still
not
know
because
it's
poised
to
be
set
to
null
or
they'd
be
the
other
case
where
it
is
already
know,
and
then
but
the
other
spirits
don't
know
that
it's
not
yet
and
so
they're
going
to
start
using
the
new
thread
safe
function.
Briefly,
so
I
guess
that's
what
that's?
What
the
synchronization
here
was
meant
to
prevent
if
I,
if
I
remember
correctly
so
yeah
I
guess
this
is
value-added
at
this
point,
it's
not
nearly
rapping,
but.
G
A
A
A
G
G
G
So
if
we
add
any
api's
at
all,
then
they
need
to
be
threatened
safe
and
if
we
make
any
storage
at
all-
and
we
are
storing
the
the
pointer,
then
that
storage
needs
to
be
thread
safe.
So
we
are
adding
value
here.
We
are
not
merely
exposing
and
and-
and
the
fact
is
that
even
just
storing
the
pointer
is
needs
to
be
done
thread
safely,
because
because
you
are
now,
you
are
not
creating
two
pointers:
you're
creating
a
pointer
to
the
to
the
c
object
and
you're,
creating
a
pointer
to
the
c++
object.
G
Those
are
two
pointers
and
it
is
your
responsibility
to
to
manage.
There
are
the
access
of
of
the
C
pointer
as
on
inside
of
the
simplest
bus
pointer.
So
you
know
in
the
wrapper
we
have
two
pointers
in
the
in
the
in
the
core
library.
We
only
have
one
point
so
that
that's
the
fundamental
distinction
between
the
two,
the
way
it's
implemented
now.
I
G
Because
because
the
the
actual
structure
is
managed
by
an
API
and
it's
allocated
internally
and
it
is
freed
internally,
so
it's
a
nappy
threatening
function
was
supposed
to
be
was
supposed
to
have
the
same
semantics
as
an
ABI
value.
It
is
an
opaque
saying
that
you
can.
You
can
call
any
number
of
times,
but
the
lifecycle
of
which
you
do
not
manage
and
and
I'm
happy
value.
A
nappy
value
is
understood
to
to
sort
of
become
invalid.
G
As
soon
as
the
stack
on
mine
when
your
function
returns,
the
nappy
value
is
go
on
right
because
that's
just
how
JavaScript
works.
If
you
want
to
gain
something,
you
need
a
nappy
ref
right,
but
you
cannot
save
a
nappy
value
in
a
variable
and
and
then
and
then
just
use
it
asynchronously
that
doesn't
work
losing
or
threats
a
function.
Asynchronously
does
work
because
that's
the
whole
point
of
a
nappy
threats,
a
function.
G
So
in
a
way
today,
it's
an
app
bereft,
really
not
a
peak
value
right,
all
right,
I'm
still,
but
you
still
don't
manage
the
lifecycle.
Look
like
an
app
your
f.
You
get
to
get
a
notification
when
it's
about
to
die
right
with
finalized,
Lilly
and
and
like
an
app
your
f,
you
can
delete
it
explicitly
by
doing
an
abort,
but
unlike
an
a
PRF,
the
effect
is
not
synchronous
because
you
need
to
inform
on
the
spreads
etcetera,
etcetera,
but
basically
you
are
not
in
control
of
the
lifecycle
of
the
object.
G
You
are
really
informed
of
its
of
its
lifecycle
events,
and
so
so
so
we
need
to.
We
need
to
encapsulate
that
and
you
know,
because
we
are
informed
of
its
lifecycle
events.
Whatever
data
we
store
inside,
whatever
wrapper
we
have,
we
can
we
can
manage
the
lifecycle
of
that
data.
The
same
way
that
the
rest
as
a
function
lifecycle
is
managed.
A
H
D
G
Assume
that
you
can
reuse
that
pointer
having
been
assured
that
the
previous
one
has
been
finalized,
because
you
have
written
your
code
carefully
and
you
have
made
sure
that
you
don't
overwrite
it
while
the
other
thread
pool
is
still
in
operation.
And
so,
if
the
copy
constructor
fails
at
at
that
point,
then
that
would
be
weird
at
least
and
and
the
head-scratcher
at
worst
and
and
then
well,
not
at
worst,
but
it
at
some
worst
stage
and
then
just
the
source
of
confusion.
It's
it.
G
Should
be
able
to
assign
a
bit
value
again
so
so
of
implementation,
I
mean
it
seems
like
a
like.
A
flag
might
be
Mordor,
saying:
okay,
this
this
value
can
now
be
reassigned.
So
you
know
the
final.
The
final
thing
that
the
finalizer
does
is
to
set
the
value
to
true,
as
in
yes,
you
may
assign
and
forth
or
in
the
first
does,
is
set
the
value
to
false
right
after
a
successful
call
to
nabi,
create
thread
safe
and-
and
it's
not
culpable
in
that
interval,
but.
J
A
I'm
trying
to
do
is
see
if
we
can
and
I
have
to
go
in
two
minutes,
because
I
have
another
call,
but
what
I'm
trying
to
see
is
if
we
could
limit
rather
than
trying
to
you
know,
add
in
functionality
and
try
and
have
you
know,
synchronization
everything
to
make
this
thread
safe.
Can
we
constrain
the
use
case
for
something
that
will
always
be
thread
safe
anyway?
A
G
A
No
modifying
right
state
right
and
then,
in
the
case
of
of
reusing
it
again
you
could.
You
could
say
that
okay,
you
can
reuse
it
in
the
same
thread.
However,
the
problem
is,
is
that
you
don't
know
when,
like
if
you
said
I'm
done
with
this,
you
don't
actually
know
when
the
rest
of
the
threads
are
finished.
Unless
there's
real
synchronization
going
on
right
and
yes,.
G
After
all,
the
other
threads
have
said,
I
will
no
longer
use
this.
So
so
essentially
so
essentially,
let's
say
let's
say
we
did
a
boolean
that
says.
Finalizer
has
completed
all
right
now.
If
we,
if
we
have
a
thread
slave
like
if
we,
if,
if
we
access
that
Orion,
synchronously
or-
and
you
know
like
with
the
mutex
around
it
and
everything.
H
G
E
G
G
Yeah
yeah,
you
would
work,
but
if
you
have
a
larger
structure
of
which
the
thread
safe
function
is
the
field
now
that
field
has
become
that.
You
need
to
recreate
the
entire
structure
for
that
one
field
right,
because
in
a
real
application,
chances
are
the
thread.
Safe
function
is
part
of
a
larger
structure
or
it's
possible
that
it's
part
of
a
larger
structure.
So
now
you
basically
rendered
part
of
the
parent
structure,
read-only
right.
A
A
G
I
G
If
that's
what
you
did
idea
right,
because
I
I
think
I
think
correct
me.
If
I'm
wrong
people
was
simply
crippled,
people
would
simply
heap-allocated
and
then
would
check
you
know,
can
I
assign
to
it
or
or
they
were
just
him
to
create
a
point
there
at
that
point,
because
they
know
that
that
it's
safe
to
create
a
point
there.
So
so
then
it'll
basically
be
the
same
as
overriding
it.
G
I
G
Exactly
yeah
one
thing:
one
thing
we
should
be
looking
at
is:
what
will
the
users
could
look
like
in
the
end
right?
There's
gonna
be
a
lot
of
repetition.
You
know
something
like
you
know.
If
they're
gonna
be
like
like
like
bookends,
you
know
like
you
create
you
create
the
thing,
then
you
say
X,
then
you
use
the
thing
and
then
you
say
Y
and
then
you
delete
the
thing
and
the
X
and
the
y
can
be
made
part
of
creation
and
deletion
respective
right.
G
So
we
say
right
that
we
need
to
know
that
x
and
y
is
always
going
to
happen
right
and
and
so
if
we
can
just
incorporate
them
into
creating
and
delete
the
thing
you
know
so
so
what
we
know
that
that
is
the
case
then,
and
we
can
do
it
right.
That
is
the
only
consideration.
I
think
that
we
may
want
to
address
with
this
wrapper,
but
no
more
than
that
basically
way.
I
think
about
it
is
no
doubt
on
API
is
a
bunch
of
really
really
fancy
C
macros.
G
G
G
A
A
E
G
E
G
G
It
is
now
once
again
safe
to
accept
a
core
threads,
a
function
value,
and
this
is
how
you
will
mark
it
as
being
safe,
as
in
it
is
once
more
an
empty
vessel,
so
yeah
in
a
way
it
away,
yeah
that
I
think
that
the
unique
pointer
and-
and
and
this
finalize
it
together-
they
accomplish
this
thing.
Where
I
think
you
know
you
can't
you
can't
assign
to
this
value
if,
if
it
hasn't
been
finalized,
so
okay,
that's
good
guys.
I
G
But
wait
a
second
like
if
you
okay,
so
you
know,
let's
say:
you're
you're,
not
careful,
right
and
and
you
so
you
dirty
or
your
secondary
threads,
keep
using
the
thread
safe
function,
even
though
finalizer
what's
called
right,
mm-hmm.
So
now,
all
of
a
sudden,
because
it's
in
a
unique
pointer
right
all
of
a
sudden
you're
you're
you're
you,
you
still
make
it
o'clock
in
a
non-blocking
calls
in
the
secondary
threads.
G
All
of
a
sudden,
the
blocking
a
non-blocking
cause
would
be
made
against
the
novel
threads
of
a
function
pointer
because
the
the
inside
function,
pointer
will
have
been
will
have
been
updated
inside
the
object
right.
So
that's
going
to
start
the
erroring
out
with
would
not
be
invalid.
Alright,
good!
You
don't
it's
null
now,
so
you
know
those
postings
did
great
pretty
quickly
but
potentially
in
a
graceful
way,
because
it
is,
after
all,
an
API
returning
our
an
error
value
rather
than
a
sexual.
G
A
G
I
G
A
G
I
G
A
G
G
That's
true:
the
thief
here
doesn't
make
any
sense,
because
it
yeah
exactly
doesn't
make
sense.
It
is
all
it's
always
gonna,
be
no!
No,
because
that's
the
point
you're
finalizing
it
so
therefore,
is
not
not,
and
so,
if
you
set
it
to
null
and
that's
it
and
you're
done
okay,
so
the
interesting
thing
here
is
I
think
that
works
actually.
So
so,
when.
J
G
G
I
I
G
A
Ahead,
no,
no,
you
go
ahead.
Yeah,
but
then
has
to
be
very
well
documented
that
the
finalizing
again
can't
be
tied
to
the
like.
You
don't
get
it
to
fan
out
to
all
your
copies.
It's
just
a
one
finalization
thing
which
will
happen
once
on
some
thread,
but
don't
don't
rely
on
anything
inside
the
C++
wrapper.
That's
not
static!.
G
G
G
So
if
the
finalizer
it's
safe
to
free
all
the
memory
used
by
all
the
threads,
because
all
the
threads
are
gone,
you
can
safely
assume
that
in
fact,
in
fact
in
the
poor
documentation
it
an
example,
it's
given
where
the
where
the
job
of
the
finalizer
it
is
to
wait
on
the
threads.
So
so
so,
basically
you
I
mean
you
know
three
threads
need
to
be
waited
on
right
in
order
for
them
right.
Yes,
there
is
a
way
to
do
it
without
a
way
implant,
but
you
should
be
waiting
on
the
threads
right.
H
G
H
J
A
A
G
So
adding
adding
fuel
to
the
class
is
not
is
not
the
mechanism
by
which
you
get
that
into
threads.
With
with
this
domestic
monster,
the
semantics
of
the
threats,
a
function
are
a
function,
call
meaning
that
originates
from
the
thread
right
and
it
goes
to
its
from
the
main
thread.
It's
marshaled
into
JavaScript,
the
return
value
doesn't
even
a
mechanism
for
return
value,
so
it's
marshal
to
do
JavaScript,
and
that's
it.
No,
no,
like
a
rat.
If
you
want
the
round
trip,
you
have
to
use
your
own
synchronization
already.
I
was
just
at.
A
G
Definitely
not
safe,
but
but
if
you
just
use
the
API
here,
then
you
are
safe
because
because
you
know
you've
passed
it
to
a
new
thread.
The
new
thread
is
allowed
to
call
acquire
if
you
can
even
call
acquire
before
you
pass
it
to
a
new
thread
and
then
and
the
news
right
doesn't
need
to
call
the
choir
and.
D
G
A
J
A
A
A
H
A
A
G
E
G
What
I'm
saying
is
okay,
so,
let's,
let's,
let's
look
at
it
from
the
point
of
view
of
the
thread
which
is
about
to
pass
the
test
event
yourself
in
there
thread
and
yeah
okay,
so
so
the
first
thing
the
the
source
thread
is
doing
is
assigning
tsf
fan
wherever
it's
supposed
to
be
right,
yep
next
line,
it
makes
a
call
to
the
threat.
So
when
the
next
line
execute
so
the
first
line
must
already
have
completed
successfully.
Therefore,
TS
FN
must
have
successfully
been
written
to
where
it
needs
to
be
written,
but.
A
Only
only
in
the
cache
for
the
threat
not
into
real
memory
in
real
memory
it's
pending,
but
because
of
the
multi-level
caches,
each
thread
can
actually
have
like.
Unless
you
have
the
hardware
instructions
that
say,
you
know
flush
flush,
my
caches,
so
that
it's
you
know
you
see
the
same
thing
across
threads
I
can
write
to
address.
One
thousand
and
another
thread
can
immediately
read
from
one
thousand
and
get
a
different
value.
Oh.
A
G
G
Is
that
the
thread
the
secondary
thread
already
has
access
to
the
location
where
the
TS
defend
would
be
stored?
Yes,
okay,
right,
right,
right,
okay,
so,
okay,
so
I
guess
what
I'm
saying
is:
I
guess.
My
my
assumption
here
is
that
is
that
the
secondary
thread
will
not
be
accessed
in
that
location
until
it's
told
by
the
primary
thread:
here's
the
threads
a
function
right,
but
otherwise
like
okay.
G
A
It's
not
it's,
not
even
the
partial
right
like
it's
that
you
know
things
can
just
stay
in
the
caches
until
until
there's
until
there's
something
in
the
processor
that
says
make
it
so
that
multiple
threads
will
have
the
same
view
like
I
could
write
five
to
save,
got
address.
1000
I
could
write
five
so
say:
there's
six
there
I
could
write
five
to
it
and
unless
there's
some
event
at
the
processor
level
that
says,
okay,
flush
that
address
1,000
other
threads
will
continue
to
read
far.
We've
read
sex.
A
Right
in,
like
you
know,
on
each
of
the
instructions,
there's
different
thing,
there's
different
sorry.
The
instruction
sets
there's
different
instructions.
You
can,
you
know,
like
you,
can
do
write
barriers,
read
barriers
that
basically
say.
Okay
at
this
point,
I
want
to
make
sure
that
everything
that's
been
written
is
flushed
out
to
memory,
so
that
any
other
thread
after
this
point
will
read
the
value
or
but
in
unless
you
invoke
one
of
those
instructions,
there's
no
guarantee
as
to
what
the
view
of
memory
from
other
threads
will
be.
A
I
Well,
I'm,
not
100%
I'm,
not
really
seeing
the
problem.
In
this
scenario
aware
so
those
say
you
have
one
master
main
thread
where
you
call
the
create
thread
safe
function
and
then,
if
that
value
is
now
a
memory.
But
then
when
you
say
that
now
you
create
a
bunch
of
threads
and
you
pass
a
copy
of
the
thread
safe
function
which
would
just
have
a
copy
of
the
point.
Sugar
right
to
the
underlying
nappy
thread,
safe
function.
G
A
G
You
know
I
mean
II
yeah,
you
allocate
some
memory,
you
initialize
it
to
a
value
and
then
you
pass
W.
You
create
a
thread
and
you
pass
a
pointer
to
that
thread
to
that
memory.
To
that
thread,
then
then
yeah,
if
the
memory
hasn't
been
written
by
tendon.
Yes,
when
the
thread
starts
it
it
may
be
accessing
the
wrong
answer.
D
G
Thread
so,
like
you
know,
if
I
set
a
location
in
memory
to
one
and
then
I
access
it
from
the
same
thread
right
if
it
hasn't
been
written
to
memory
yet
and
from
the
same
thread,
it
will
also
not
be
one
hey,
because,
because,
when
I
dereference
a
pointer
in
the
same
thread,
I
why
I
am
saying
go
through
that
memory,
location
and
fetch.
That
thing
was.
D
A
D
G
G
A
That's
kind
of
what
I'm
thinking
like,
especially
if
like
because
otherwise
yeah
I,
that
was
my
guess
that
that
thread
start
will.
Actually,
you
know,
say:
okay
well,
if
we're
doing
that,
let's
flush
the
and
make
everything
consistent.
Whereas
if
you,
if
you
somehow
pass
it
to
an
already
running
thread,
there's
a
much
you
know
there
isn't
going
to
be
necessarily
anything
which
enforces.
G
G
Already
running
thread
right,
then,
then,
all
the
mechanisms
by
which
you
pass
anything
from
from
the
main
thread
into
the
already
running
thread
our
mechanisms
under
your
control
right
because-
and
this
is
actually
one
of
the
primary
used-
it's
a
function
right.
This
is
where
you
already
have
a
threading
implementation,
and
you
just
need
to
inform
JavaScript
that
something
has
happened
right
and
and
you
don't.
You
don't
wish
to
rewrite
your
threading
implementation
to
use
async
because
because
or
hasten
worker,
because
that
uses
a
thread
you
don't
you
have
no
control
over
the
threads
right.
G
So
that
was
the
original
motivation
behind
Rancic,
though
so,
because
you
have
a
existing
threading,
threading
implementation,
you
also
have
a
mechanism
to
pass
things
between
threads,
which
presumably
is
thread
safe,
and
so
so
the
value
that
you
pass
into
your
existing
custom
thread
pool
now
is
the
thread
safe
function
right.
So
how
does
happen?
G
You
have
create
the
thread-safe
function
and
then
you
passed
it
into
those
into
your
thread
using
a
thread
safe
mechanism
that
you've
been
using
so
far,
but
for
different
kinds
of
things,
all
right,
and
so
so
so
because
it's
versatile
man
ism
by
which
you
pass
the
pointer
in
to
your
your-your-your
already
existing
threading
implementation
is
thread
safe.
Therefore,
when
the
value
arrives
on
the
other
thread
and
the
other
salts
about
you,
it
will
have
been
correctly
written.
So
it's
it.
G
A
A
I
G
You
know,
speaking
of
all
these,
all
these
already
running
threads.
You
know
one
if
you're
working
on
this,
then
then
one
of
the
tests
you
might
want
to
add
is
is
what
we
just
talked
about
where
you
just
fire
up
a
bunch
of
thread.
Let
them
run
five
seconds
and
then
I
pass
the
thread
safe
function
and
and
start
the
work.
You
know
because
right
now,
I
think
the
only
test
we
have
is
you
know
in
comes
a
request
from
JavaScript.
You
create
the
thread
state
function,
you
start
the
threads
with
the
thread.
G
G
You
know
in
a
leap,
word
I
know,
but
they
run
busy
in
a
loop
and
then
we
pass
in
the
that's
a
function,
so
that
will
probably
be
something
I'll,
create
a
thread
set
function
and
then
signal
a
condition.
Variable
and
the
stress,
the
threads
will
then
watch
for
the
condition
and
then,
when
the
condition
is
true,
they
would
value
and
do
whatever
they
do
now.
G
Only
after
the
fact-
and
you
may
even
leave
the
running
for
a
little
bit
after
they're
done
so
so
so
maybe
after
I
guess
that's
kind
of
pointless,
because
if
you
think,
if
you
write
it
correctly,
which
is
you
know,
they
release
the
threads
a
function
or
you
know
they
are
after
closing,
then
you
know
if
you
should
put
off
if
you
put
on
idle
or
if
you
put
a
busy
you
after
that.
After
that
fact
that
runs
for
10
seconds,
it
doesn't
matter
right
because
they
ten-second
or
for
the
finalizer
to
join
the
threat.
G
A
A
G
G
B
J
E
G
A
A
A
G
A
A
G
Yeah,
I
guess
I
guess
you
know
in
a
way
what
we're
talking
about
this
sort
of
buried
in
the
expression
we're
using,
because
we're
saying
when
you
pass
the
value
to
another
threat,
passing
the
value
to
another
thread
involves
exactly
the
kind
of
the
kind
of
flushing
of
caches
and
all
that
yeah.
We
could
talk
all
right,
yep,
so
yeah.