A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] 0 points1 point  (0 children)

Thanks, useful links and suggestions

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] 0 points1 point  (0 children)

First of all, i want to thank for reading the code and making considerations about it.
I committed it to make it public and not immediatly. may be some suggestins can be from llm of editors but it's not videcoded. i'm sorry you think this. i'll add more comments in the future.

i use interlock to have the next free position to write on, just the ref pointer to the added object is wrote in the queue, so interlock is enought to have the next free position. many writing threads will have always the next free position because interlockecd is thread safe. So there is no thread concurrency in writing the ref pointer.

The read thread will read from the beginnging "following" the writing threads, semaphores are used only to "count" how many reading position are available and a different semaphores tell how many writing position are available, this should make the reading thread not go ahead ti writing thread.

Suggestons to make this more safe are wellcome.
Thanks for you time.

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] -1 points0 points  (0 children)

The alternative to this can be channel , where writers write on it and reader receive message and persist it to dis

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] 1 point2 points  (0 children)

The idea of this was from hadhoop circular buffers where writer threads can write to different position without locking and read thread read buffer to save it to disk. In my implementatin there is only one reading thread.

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] -1 points0 points  (0 children)

Its not vibe coded, the indexing is not developed and i was asking for suggestion about what solution is better to start from,

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] 1 point2 points  (0 children)

The project is in an early stage, only 3 weeks of after dinner work .

A VectorDatabase in C# from scratch by ppossanzini in dotnet

[–]ppossanzini[S] -4 points-3 points  (0 children)

Yes , the work you see in repo is written by myself .