| 354 | } |
| 355 | |
| 356 | void init_deeplake() |
| 357 | { |
| 358 | static bool initialized = false; |
| 359 | if (initialized) { |
| 360 | return; |
| 361 | } |
| 362 | initialized = true; |
| 363 | |
| 364 | // Register exit handler first (runs last due to LIFO order) to use _exit() |
| 365 | // and avoid C++ static destructor crashes in background workers. |
| 366 | on_proc_exit(deeplake_quick_exit, 0); |
| 367 | |
| 368 | constexpr int THREAD_POOL_MULTIPLIER = 8; // Threads per CPU core for async operations |
| 369 | deeplake_api::initialize(std::make_shared<pg::logger_adapter>(), THREAD_POOL_MULTIPLIER * base::system_report::cpu_cores()); |
| 370 | |
| 371 | pg::table_storage::instance(); /// initialize table storage |
| 372 | |
| 373 | RegisterXactCallback(deeplake_xact_callback, nullptr); |
| 374 | } |
| 375 | |
| 376 | } // namespace pg |
no outgoing calls
no test coverage detected