Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
key-value-store
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Samarth Joshi
key-value-store
Commits
18527950
Commit
18527950
authored
Nov 10, 2020
by
Samarth Joshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added dynamic lru cache size
parent
092592f7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
6 additions
and
7 deletions
+6
-7
Client
Client
+0
-0
File1.txt
File1.txt
+0
-0
KVClient.c
KVClient.c
+1
-1
KVServer.c
KVServer.c
+0
-1
LRU.c
LRU.c
+2
-2
LRU.h
LRU.h
+1
-1
Server
Server
+0
-0
settings.conf
settings.conf
+2
-2
No files found.
Client
View file @
18527950
No preview for this file type
File1.txt
View file @
18527950
No preview for this file type
KVClient.c
View file @
18527950
...
...
@@ -148,7 +148,7 @@ int main(int argc, char const *argv[])
int
seconds
=
1
;
int
i
;
if
(
0
)
{
if
(
1
)
{
sock
=
client_init
();
interactive
(
sock
);
return
0
;
...
...
KVServer.c
View file @
18527950
...
...
@@ -204,7 +204,6 @@ int main (int argc, int argv) {
printf
(
"%d
\n
"
,
settings
->
listening_port
);
printf
(
"%d
\n
"
,
settings
->
cache_size
);
printf
(
"%d
\n
"
,
settings
->
thread_pool_size
);
return
0
;
//int *pipes = (int*) malloc(pool_thread_size * 2 * sizeof(pipes));
int
pipes
[
50
][
2
];
// TODO: initialize pipes dynamically
...
...
LRU.c
View file @
18527950
...
...
@@ -12,7 +12,7 @@
#define CLEAR __atomic_clear
struct
KV
*
array
[]
;
struct
KV
*
*
array
;
struct
queue
*
qu
=
NULL
;
struct
queue
*
last
;
unsigned
_Atomic
lock
=
0
;
...
...
@@ -180,7 +180,7 @@ int cache_get(char *key, char *value)
void
init_cache
(
int
size
)
{
maxsize
=
size
;
array
=
(
struct
KV
*
)
malloc
(
maxsize
*
sizeof
(
struct
KV
));
array
=
(
struct
KV
*
*
)
malloc
(
maxsize
*
sizeof
(
struct
KV
));
for
(
int
j
=
0
;
j
<
maxsize
;
j
++
)
{
array
[
j
]
=
(
KV
*
)
malloc
(
sizeof
(
KV
));
...
...
LRU.h
View file @
18527950
...
...
@@ -26,7 +26,7 @@ struct queue{
struct
queue
*
next
;
};
extern
struct
KV
*
array
[]
;
extern
struct
KV
*
*
array
;
extern
struct
queue
*
qu
;
extern
struct
queue
*
last
;
...
...
Server
View file @
18527950
No preview for this file type
settings.conf
View file @
18527950
listening_port
=
8000
cache_size
=
10
thread_pool_size
=
10
\ No newline at end of file
cache_size
=
15
thread_pool_size
=
10
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment