►
From YouTube: Node.js N-API Team meeting - 9 Sep 2019
Description
A
A
Okay,
so
the
first
issue,
which
was
tagged
as
building
add-ons,
was
C,
make
I
did
tag
it
so
that
we
could
have
some
discussion
with
Jim
since
he's
done,
some
work
I
think
he
mentioned
with
like
one
of
the
tools
that
lets
you
build
with
me.
So
I'm
gonna
suggest
me.
We
just
skip
until
the
meeting
when
he's
available
when
he's
available.
B
A
A
A
A
B
C
D
A
C
C
Exactly
yeah
yeah
yeah,
that
seems
to
have
been
sort
of
passed
off
to
be
a
token,
so,
yes,
I,
think
established
even
function.
You
this
function,
template
internally,
yeah.
A
C
A
So
that
one
still
been
out
for
a
little
bit
and
it
could
use
some
time,
I
haven't
had
a
chance
to
go.
Look
at
it.
I
think
it
was
basically
the
fix
broke
one
of
the
earlier
versions,
so
we'd
have
to
figure
out
what
to
do.
In
that
context,
oh
I'm
wondering
I,
haven't
had
a
chai
I
wanted
to
try
and
take
a
look
late
last
week.
Just
didn't
quite
get
to
it,
I'm
wondering
if
we
can,
like
you
know.
If
we
didn't
see
people
complaining
about
it
in
earlier
versions,
you
know.
A
E
D
C
E
And
his
his
use
case
is
fair,
I.
Imagine
but
yeah.
There
is
no
copy,
constructor
and
I
think
that
in
the
implementation,
there's
like
a
unique
pointer
that
the
the
the
wrapper
class
has
for
the
for
the
nappy
thread-safe
function,
so
I
think
that
may
disqualify
it
from
having
a
proper
copy
consumer.
If
I'm
not
mistaken,.
D
C
Yeah
yeah
cuz
I
mean
the
the
the
court
for
a
sake.
Function
can
be
copied
ad
infinitum
because
I
asked
the
printer,
so
oh
yeah,
that's
I,
I,
don't
know
how
we
can
tackle
semantics
on
the
class
yeah.
C
My
impression
from
from
the
beginning
was
that
it's
gonna
be
kind
of
hard
to
wrap
this,
because,
because
the
you
know
basically,
you
cannot
really
provide
that
much
value.
You
know,
but
if
I
wrapping
it
because
you
know
any
any
sort
of
any
sort
of
logic
that
you
add
that
that's
providing
value
is
going
to
have
to
be
thread
safe
itself,
but
so
so
you're,
essentially
building
on
top
of
the
thread
safe
function
instead
of
just
exposing
it.
You
know
right.
B
C
My
initial
impression,
but
the
by
okay,
I,
guess
I,
guess
we
can
hit
this
far
and
it
does
kind
of
work
but
I
guess
it
can't
cover
all
the
use
cases
that
the
court
writes
a
function
can
cover
so
man
I,
don't
know.
Maybe
what
we
need
is
we
need
a
constructor
that
takes
an
existing
thread.
Safe
function,
I
don't
know:
do
we
have
one
of
those
that
just
you
know
takes
whatever
it
has.
B
C
B
C
E
C
A
C
C
A
C
C
Like
fundamentally,
if
we
pass
a
pointer
to
to
a
threats,
a
function
class
to
an
instance
of
a
threat
state
function,
class
which
can
think
the
pointer,
that
is,
the
core
threats
a
function
now,
if
you
get
a
manage,
you
got
to
manage
the
lifecycle
of
the
of
the
pointer
to
the
class
instance
I,
and,
and
so
you
need
to
sort
of
I
mean
you
do
have.
You
do
have
pretty
good
management,
because
you
know
you
create
it
when
you
create
the
thread
safe
function
and
you
and
you
destroy
gearing
finalized.
C
You
can
rest
assured
that
there
is
no
contention
for
the
point
that
nobody
is
going
to
ever
access
the
pointer
ever
again,
because
all
the
references
have
been
really
no.
So
so,
if
we
wrap
it
into
a
in
a
plane,
pointer
then
and
I
don't
see
why.
That
would
be
what
it
would
be
bad.
You
know,
except
of
course,
well
yeah
yeah
I,
don't
see
why
it
would
be
bad
to
do
that.
C
A
D
E
B
C
E
Well,
would
it
be
valid
to
have
one
of
these
instances
having
a
pointer
to
a
nappy,
thread-safe
function?
That
is
no
longer
valid
because,
like
after
because
say
that
we
were
using
a
regular
pointer
that
would
allow
us
to
copy
the
instance
then,
but
now
we
would,
after
the
the
thread-safe
function
is
finalized.
We
would
not.
E
A
C
Yes,
no
because
the
the
common
object
cannot
be
free
until
a,
although
all
the
copies
are
somehow
released
right,
because
the
common
object
just
holds
the
threads
a
function,
but
it
is
not
itself
the
threatening
function
right.
So
if
you
delete
the
common
object
now
you
have
the
same
problem
as
you
did
would
live
with
1/4
threats
a
function.
How
do
you
update
all
the
all
the
references
to
say
that
the
common
object
is
gone,
but.
C
A
A
A
C
A
C
B
C
Well,
no
because
because,
although
although
the
thread-safe
function
has
been
deleted,
I
references
to
it
may
be
left
over
in
the
code
and
all
those
references
have
now
to
reflect
the
fact
that
the
threat
C
function
is
gone.
So
you
know
they
must
return
like
invalid
or
closed
or
whatever,
for
as
long
as
they
are
still
within
scope
and
allocated.
Okay,.
C
But
yeah
I,
don't
know
how
far
we
can
push
these
semantics
right
because,
okay,
yes,
they
cannot
call
things
like
you
know
like
a
pole
or
a
sink
or
what
is
that
called
you're,
a
blocking
call,
no
I'm,
locking
called
a.
They
cannot
call
those
functions
that
might
be
promised
not
to
call
them,
but
but
you
know
there
may
still
be,
like
instance,
methods
that
you
know
that
they
can
call
you
know,
and
so
so
I
don't
know,
I
don't
know.
If
we
can,
you
can
delete
the
underlying
underlying
reference
counting
mechanism.
C
C
B
A
To
to
see
here,
basically
there's
a
point
where
they
basically
said
you
know
you
can
no
longer
use
the
thread
safe
function,
mm-hmm,
and
if,
at
that
point
we
can
be
sure
that
they're
never
going
to
use
the
class,
then
we
could
delete
internal
pointers
or
whatever
you
know,
do
whatever
we
want
right
and
I
guess
the
concern
is
Gabriel
is
thinking.
Maybe
they
can
still
call
some
of
the
methods,
even
though
they've
agreed
not
to
call
some
of
the
main
methods
but
I'm
trying
to
understand
then
well.
What
would
it
be
that
they're
calling.
C
Okay,
but
can't
call
this
context
because
context
is:
is
it
basically
boils
down
to
to
not
be
thinking
I.
E
C
C
A
E
A
A
A
E
C
C
A
F
E
E
C
A
C
C
C
A
C
A
A
D
E
C
C
All
those
different
coffees
they,
basically
they
don't
worry
about
my
it's
a
life
cycle
of
it
only
only
to
to
pass
straight
through
to
Korra
API
and
that's
it
so,
you
know,
and
and
by
the
five
semantics
to
the
threads,
a
function
I,
don't
believe
there
should
never
be
a
situation
where,
where
you're
going
to
call
from
a
secondary
thread
and
you're
gonna
sect
fault,
because
the
threads
a
function
was
destroyed
on
the
main
thread.
That
should
never
happen.
C
C
See
purpose
instance
like
this,
naturally
going
for
a
function.
If
you
pass
as
a
pointer
into
into
the
secondary
friends
and
as
long
as
everybody
does
require
and
release
appropriately,
then
there
should
be
no
problem
again
right.
Yeah.
A
C
Well,
no
yeah,
that's
right!
Yeah!
You
will
delete
yeah
if
we,
if
we
pass
that
pass
the
C++
instance
as
a
round
as
a
pointer,
then,
and
then
you
know,
there
is
no
issue
of
a
copy
constructor,
because
you're
just
passing
a
pointer
and
we
don't
need
to
do
any
ref
counting,
because
the
final
answer
happens
exactly
once
and
on
the
main
thread.
C
So
that's
taken
care
of
the
only
thing
we
need
to
worry
about
is
is
that
when
we
call
the
finalize
callback,
it
is
very
likely
that
that's
going
to
delete
the
instance
inside
which
we
are
playing
so
so,
if
we
want
to
so,
we
should
avoid
mulling
out
the
pointer
at
that
point
and,
and
we
should
stop
making
references
to
remember
variables
of
the
instance.
That's
the
only
thing
we
need
to
worry
about
that.
C
So
basically
make
copies
of
all
the
variables
that
you
need
from
the
instance
inside
the
scope
and
then
call
the
call
the
callback
finalize
fallback
and
then
just
use
those
variables
for
whatever
it's
the
same
thing
that
we
had
in
an
API
core.
With
with
like
the
async
basic
worker,
where
you
know
we,
you
know,
we
called
called
the
the
a
co-worker
and
then
we
were
using
the
environment
stored
inside
the
ayzik
marker,
and
that
was
calling
suck
balls.
C
A
A
Ok,
it's
got
to
be
in
there.
I
know
it's
in
it's
in
the
other
one.
That's
why
I?
Okay,
a
unique
like
this
doesn't
delete
anything
right.
C
A
A
E
A
F
A
E
B
A
C
A
C
A
A
C
C
A
C
Kind
of
tempting
to
to
write
a
mechanism
where
you
know
you
can
you
can
declare
a
thread
safe
function,
inside
the
scope
and
and
and
just
use
like
REI
I.
You
know
where
you
declared
that,
because
you
know,
threads
threads
are
usually
simple.
They're,
like
you
know,
start
the
function,
while
true
do
something
really
heavy,
and
then
you
know
if
something
then
break
and
exit
right.
C
So
so
at
that
point
to
declare
something
at
the
top
of
the
of
the
function
which
basically
resulted
in
a
choir
and
and
it
results
in
a
release
when,
when
when,
when
the,
when
the
object
goes
out
of
scope,
it's
very
tempting,
because
that
would
be
a
very
clean
implementation,
but
I'm
not
sure
if
this
is
capable
of
that
as
it
is,
and
that
that
would
be
what
you
said
where
you
were.
You
know:
writing
the
object
name
as
a
choir
and
when
he
goes
out
of
scope
is
the
same
as
release
yeah.
A
Okay,
that
wasn't
that
wasn't
quite
what
I
was
thinking
of,
but
it's
long
yet
like
what
I
was
thinking
of
the
cases
as
soon
as
you
make
a
copy,
even
if
the
copy
was
using
like
saved.
For
some
reason,
the
same
thread
was
using
two
different
copies
if
either
one
of
those
hits
like
it's
back
to
what
you
were
saying,
though,
is
you
it's
it?
E
If
one
of
the
nappies
a
so
for
each
copy,
that's
made
and
acquire
each
copy
has
to
get
either
at
a
release,
call
or
one
of
the
closing.
So
you
know
if
I
have
created
my
original
text,
a
function
and
I've
copied
it
then,
as
soon
as
I've
made
an
acquire
at
that
point,
I
really
don't
care
about.
What's
going
on
with
other
threads,
because
as
soon
as
I
do
a
release
or
closing
or
get
it
closing,
then
I
know
that
I
am
done
yeah,
but.
E
C
Right
now,
whether
that
uses
is,
is
it's
nice
and
convenient
or
or
whether
you
have
to
you
know,
write
a
lot
of
code
like
acquire
and
release,
and
you
have
to
handle
the
case
of
closing
all
the
time.
That
creates
a
pattern
which
may
or
may
not
be
convenient.
But
but
it
is
correct
you,
when
used
right.
C
Basically,
I'm
starting
to
think
that
that
this
is
best
used
as
a
pointer.
You
know
so
just
you
know
you
and
that'd
be
cool
and
call
and
thread
safe
function
and
then
just
pass
the
pointer
around
and
then
you
can
make
any
number
of
copies
and
and
then
you
know
for
for
anyone,
those
copies,
you
call
the
choir,
you
use
that
you've
called
release
and
that's
it
and
then
the
ref
counting
happens
inside
an
API
core.
A
C
So
so
you
don't
need
to
worry
about
about
concurrency.
All
you're
doing
is
reading
off
the
threats,
a
function
of
the
time
and
I'm
just
passing.
Let's
review
the
threats,
a
function
API
and
that
API
will
then
safely
access
and
modify
the
state
so
you're
not
ever
actually
modifying
any
state
like
the
C++
instance.
So
it
should
be.
It
should
be
safe.
A
D
D
A
C
A
C
You
know
one
interesting
question,
though,
like
if
this
is:
if
this
is
an
instance,
then
how
do
you
pass
this
to
a
threat,
like
my
understanding?
Is
that
most
thread,
libraries
they
accept
the
boys
are,
and
they
pass
that
to
the
entry
point
of
the
thread
and
that's
it.
So
how
about
the
N?
Do
you
pass
and
not
be
threatened
function
into
the
entry
point
of
a
thread?
If
that
is
not
the
point.
A
A
C
With
with
when
you,
when
you
do
like
when
you
call
that
you
know
you're
not
in
a
lab
that
function
where
you
do
like
the
end
percent,
they
maybe
teach
that
stack
during
alive.
Somehow
I
don't
know
if
she
does
any
of
that.
You
know
because,
because
they
did,
you
know
something
is
still
referencing
very
imposing
their
yeah.
If
that's
something
is
a
threat,
I
mean
for
the
sake
of
correctness.
It
would
probably
keep
those
variables
alive,
you
know,
so
you
would.
C
C
C
A
C
You
know,
then,
then,
basically,
the
lifecycle
of
the
red
section
of
the
court
state
defines
the
various
schools.
That's
good!
That's,
okay,
and
it's
okay
to
not
an
expensive
operation.
No
reference
counts
on
average
would
be
higher
than
if
you
were
to
increment
them
by
hand,
because
because
you
know
when
you
are
incrementing,
because
the
value
thread
and
and
other
everywhere
is
when
you're
incrementing,
just
because
of
my
theory
or
juggling
that's
okay,.
A
A
D
A
C
B
A
Is
there
any
any
a
cover,
a
case,
though,
where
it's
gonna
be
hard
to
force
the
instance
out
of
scope
like
you've
created
this
you've
created
this
thing
and
if
you've
got
to
actually
delete
the
object,
is
that
ever
gonna
be
an
issue
like
it's?
It's
that
guy
it's
on
the
stock,
so
you
can't
just
say
get
rid
of
this.
C
A
A
A
C
C
I,
don't
use
people
as
posted
off
tonight,
I
think
or
in
terms
of
like
I
mean
see,
I,
don't
see
how,
if
you
do,
if
you
start
a
thread,
you
can
pass
in
anything
other
than
a
pointer.
You
know,
and
if
there,
if
there
is
a
function,
is
not
a
pointer.
How
do
you
pass
that
into
a
thread?
You
know
like
okay
put
a
lambda
function
and
C++
star,
so
Matt
I
check
whereby
you
can
reference
objects
from
the
outside
scope,
even
if
they're
not
pointers?
Okay,
that's
great
enough.
C
C
A
F
A
D
A
C
A
C
Already
running,
then,
then,
you
know
those
fancy
C++
threads,
which
you
know
is
in
a
lambda
and
all
that,
then
it
would
have
to
exist
first
and
then
the
thread
start.
Whereas
if
it's
a
classical
thread,
then
yeah,
you
can
just
use
a
message
message,
passing
mechanism
to
pass
a
pointer
and
at
that
point,
have
to
call
it
quite
explicitly.
Oh,
oh.