]> git.feebdaed.xyz Git - linuxyz.git/commitdiff
add: tested map operation
authorseantywork <seantywork@gmail.com>
Wed, 20 Aug 2025 00:26:09 +0000 (09:26 +0900)
committerseantywork <seantywork@gmail.com>
Wed, 20 Aug 2025 00:26:09 +0000 (09:26 +0900)
hashmap-concurrent-perf/cmap.c
hashmap-concurrent-perf/cmap.h

index 6e4aa3b472e66a4d4dce67c86394b0e90193590f..63901ed65b5744bf698ebc2f910fceb32dd1150c 100644 (file)
@@ -1,6 +1,8 @@
 #include "cmap.h"
 
 
+#define TOTAL_VAL_COUNT 1000000
+
 #ifdef HASHCUSTOM
 static inline uint64_t _hashfunc(uint8_t* data, size_t size){}
 
@@ -24,6 +26,14 @@ static inline uint64_t _hashfunc(uint8_t* data, size_t size, uint64_t div){
 }
 #endif
 
+uint64_t _getrandu64(){
+    uint8_t data[8];
+    uint64_t val;
+    getrandom(data, 8, 0);
+    memcpy(&val, data, 8);
+    return val;
+}
+
 BOGUS_CMAP* cmap_alloc(int buck_size, int data_size){
 
     BOGUS_CMAP* cm = (BOGUS_CMAP*)malloc(sizeof(BOGUS_CMAP));
@@ -142,10 +152,27 @@ void cmap_free(BOGUS_CMAP* cm){
 
 }
 
+void _get_func(void* ret, void* data){
+
+    BOGUS_DATA* retdata = (BOGUS_DATA*)ret;
+    BOGUS_DATA* result = (BOGUS_DATA*)data;
+    retdata->value = result->value;
+}
 
-int main(int argc, char** argv){
 
+void* setter_thread(void* varg){
+    pthread_exit(NULL);
+}
+
+void* increase_thread(void* varg){
+    pthread_exit(NULL);
+}
 
+void* decrease_thread(void* varg){
+    pthread_exit(NULL);
+}
+
+int main(int argc, char** argv){
 
     return 0;
 }
\ No newline at end of file
index c12a2fc531174572cc59aea46c249d3034fb2e56..cd96622e7b9316e3b527f3ccc31eb961298aa67a 100644 (file)
@@ -8,6 +8,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <pthread.h>
+#include <sys/random.h>
 
 #include <openssl/evp.h>
 #include <openssl/hmac.h>