MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / rotsq_concurrent_first_encode

Function rotsq_concurrent_first_encode

tests/test_semantic.c:778–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

776} rotsq_thread_ctx_t;
777
778static void *rotsq_concurrent_first_encode(void *opaque) {
779 rotsq_thread_ctx_t *ctx = opaque;
780 float vec[CBM_RSQ_IN_DIM];
781 for (int i = 0; i < CBM_RSQ_IN_DIM; i++) {
782 vec[i] = ctx->value + (float)i / (float)CBM_RSQ_IN_DIM;
783 }
784 atomic_fetch_add_explicit(ctx->ready, 1, memory_order_release);
785 while (atomic_load_explicit(ctx->start, memory_order_acquire) == 0) {
786 cbm_usleep(1000);
787 }
788 cbm_rsq_encode(vec, &ctx->code);
789 return NULL;
790}
791
792/* The daemon can initialize semantic encoders from multiple request threads.
793 * Run this first so ThreadSanitizer observes the one-time initialization. */

Callers

nothing calls this directly

Calls 1

cbm_rsq_encodeFunction · 0.85

Tested by

no test coverage detected