BuildDocsReferenceGuidesBlogDiscordbun:ffiFFIFunctionthreadsafeBuildDocsReferenceGuidesBlogDiscordbun:ffiFFIFunctionthreadsafeffi.FFIFunction.threadsafethreadsafeReferenceDocsGuidesDiscordMerch StoreGitHubBlogRuntimePackage managerTest runnerBundlerPackage runnerBun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseWe're hiring →
property threadsafe | bun:ffi module | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- Can C/FFI code call this function from a separate thread?
Only supported with JSCallback.
This does not make the function run in a separate thread. It is still up to the application/library
to run their code in a separate thread.
By default, JSCallback calls are not thread-safe. Turning this on
incurs a small performance penalty for every function call. That small
performance penalty needs to be less than the performance gain from
running the function in a separate thread.