You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In plain javascript, this is probably as far as one can go, but I was wondering if using the node (addon) api either of the following items are possible
flag the callback as "threadsafe" so node will run it immediately, rather than schedule it for later
no need to callback into node (I just need delete ptr)
tell node to "run all pending callbacks" via a faster node api call
as opposed to a await sleep(0) which is not that fast, and makes everything into an async
?
The text was updated successfully, but these errors were encountered:
This issue is stale because it has been open many days with no activity. It will be closed soon unless the stale label is removed or a comment is made.
I have finally got my c++ addon to correctly memory manage wrapped objects.
What I learned is that the callbacks can only run when the main thread "yields" (e.g. via a
setTimeout
call) (there is a discussion here https://github.com/orgs/nodejs/discussions/47716).In plain javascript, this is probably as far as one can go, but I was wondering if using the
node (addon) api
either of the following items are possibledelete ptr
)await sleep(0)
which is not that fast, and makes everything into anasync
?
The text was updated successfully, but these errors were encountered: