adamierymenko / kissdb Goto Github PK
View Code? Open in Web Editor NEW(Keep It) Simple Stupid Database
(Keep It) Simple Stupid Database
Hi,
Putting stuff in the public domain feels like a "wide open" way of releasing your software, but it has a great deal of ambiguity since it doesn't really say if you're going to enforce your copyright and patents or not.
Please consider using a real Free Software license. Something that forces your code to remain free, like the GPL. If you have issues with the GPL, please consider the MIT license which is likely going to make the use of your software by other projects much easier since it states explicitly what you intend with your copyright.
Many thanks for your software and for your consideration of this issue.
Regards,
Jeremiah
Working on a multiple access database. If a call to KISSDB_get fails as the key does not exists yet then that call will always fails even though the key has been written by another process.
Not sure if this is a bug or an expected behaviour. My work around for now is to close and reopen the db.
I wrote these two codes to illustrate this. A and B. On an existing db run A which should say fail as the key 100 does not exists. While A runs run B to write the key 100. A will still say fail. Close A and relaunch. It will now find the key.
A
#include <stdio.h>
#include "kissdb.h"
#include <inttypes.h>
#include <signal.h>
#include <unistd.h>
static volatile int keepRunning = 1;
void intHandler(int dummy) {
keepRunning = 0;
}
int main(int argc, char *argv[]){
KISSDB db;
uint64_t paquets[2];
uint64_t key = 100;
KISSDB_open(&db,"test.db",KISSDB_OPEN_MODE_RDWR,1024,8,sizeof(paquets));
while (1){
if (KISSDB_get(&db, &key, paquets)) printf("fails\n");
else printf("ok\n");
sleep(2);
}
}
B
#include <stdio.h>
#include "kissdb.h"
#include <inttypes.h>
#include <signal.h>
#include <unistd.h>
static volatile int keepRunning = 1;
void intHandler(int dummy) {
keepRunning = 0;
}
int main(int argc, char *argv[]){
KISSDB db;
uint64_t paquets[2];
uint64_t key = 100;
KISSDB_open(&db,"test.db",KISSDB_OPEN_MODE_RWCREAT,1024,8,sizeof(paquets));
KISSDB_put(&db, &key, paquets);
KISSDB_close(&db);
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.