Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concurrency support #8

Open
wants to merge 32 commits into
base: concurrent
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
352e96f
Add concurrent hashtable
Nov 23, 2023
9338024
add concurrent hashtable implementation and tests
Nov 24, 2023
fe287b8
add concurrent hashtable
Nov 27, 2023
ae0de5c
Delete sftp-config.json
ChaosD Nov 27, 2023
983d620
Merge branch 'cacheMon:develop' into concurrency-support
ChaosD Nov 28, 2023
9b91050
Fix function chained_hashtable_delete_obj_id_v2
Nov 28, 2023
8e10f0b
Merge pull request #9 from ChaosD/develop
1a1a11a Nov 28, 2023
64f9eee
update README
1a1a11a Nov 29, 2023
715be58
update README
1a1a11a Dec 15, 2023
26dffad
remove self-hosted testbed
1a1a11a Dec 17, 2023
6a89a06
add dataset and change names (#43)
1a1a11a Jan 1, 2024
db6bd31
allow the algorithm name to be S3-FIFO (#44)
1a1a11a Jan 1, 2024
290101d
update trace name and fix tests (#45)
1a1a11a Jan 1, 2024
4d47e20
minor updates with several bug fixes (#46)
1a1a11a Jan 4, 2024
938165f
Minor fix (#47)
1a1a11a Jan 4, 2024
a98824e
many fixes (#48)
1a1a11a Jan 6, 2024
6439066
add random two and remove myclock (it has renamed to sieve now) (#49)
1a1a11a Jan 7, 2024
eeae989
update docker file to support ARM CPU (#50)
1a1a11a Jan 7, 2024
61c77f7
Fix two set but unused variables (#52)
nwf-msr Jan 14, 2024
921c112
update example (#53)
1a1a11a Jan 15, 2024
f6043c4
update README
1a1a11a Jan 15, 2024
f3f6ba8
update readme
1a1a11a Jan 26, 2024
1ce9ea9
minor fix
1a1a11a Jan 27, 2024
25369d4
feat(prefetch): add OBL (#57)
zztaki Feb 20, 2024
3dc3f67
Update README.md (#58)
1a1a11a Feb 20, 2024
e075986
feat(prefetch): add pg (#59)
zztaki Feb 22, 2024
d27a7fd
chore: improve copying request (#60)
zztaki Feb 23, 2024
3080f2c
docs: update admission and prefetch (#61)
zztaki Feb 23, 2024
0252dcf
minor updates
1a1a11a Mar 17, 2024
abbec84
Resovle conflicts between master and branch
Apr 19, 2024
a48f493
Merge branch 'cacheMon-develop' into concurrency-support
Apr 19, 2024
a726b56
add concurrent support
Apr 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion libCacheSim/cache/cacheObj.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,30 @@
#include "../include/libCacheSim/macro.h"
#include "../include/libCacheSim/request.h"

/**
* [verify the fingerprint of cache_obj]
* @method verify_cache_obj_fingerprint
* @author Chaos
* @date 2023-11-22
* @param cache_obj [pointer of cache item]
* @return [is valid or not]
*/
bool verify_cache_obj_fingerprint(const cache_obj_t *cache_obj) {
return cache_obj->obj_id == cache_obj->fingerprint;
}

/**
* [set the fingerprint of cache_obj]
* @method set_cache_obj_fingerprint
* @author Chaos
* @date 2023-11-22
* @param cache_obj [pointer of cache item]
*/
void set_cache_obj_fingerprint(cache_obj_t *cache_obj) {
cache_obj->fingerprint = cache_obj->obj_id;
}


/**
* copy the cache_obj to req_dest
* @param req_dest
Expand All @@ -17,7 +41,7 @@ void copy_cache_obj_to_request(request_t *req_dest,
req_dest->obj_id = cache_obj->obj_id;
req_dest->obj_size = cache_obj->obj_size;
req_dest->next_access_vtime = cache_obj->misc.next_access_vtime;
req_dest->valid = true;
req_dest->valid = verify_cache_obj_fingerprint(cache_obj);
}

/**
Expand All @@ -34,6 +58,7 @@ void copy_request_to_cache_obj(cache_obj_t *cache_obj, const request_t *req) {
cache_obj->exp_time = 0;
#endif
cache_obj->obj_id = req->obj_id;
set_cache_obj_fingerprint(cache_obj);
}

/**
Expand All @@ -48,6 +73,26 @@ cache_obj_t *create_cache_obj_from_request(const request_t *req) {
return cache_obj;
}

/**
* [create a cache_obj from obj_id]
* @method create_cache_obj_from_obj_id
* @author Chaos
* @date 2023-11-22
* @param obj_id [Given obj_id]
* @return [cache_obj]
*/
cache_obj_t *create_cache_obj_from_obj_id(const obj_id_t obj_id) {
cache_obj_t *cache_obj = my_malloc(cache_obj_t);
memset(cache_obj, 0, sizeof(cache_obj_t));
cache_obj->obj_id = obj_id;
cache_obj->obj_size = 0;
#ifdef SUPPORT_TTL
cache_obj->exp_time = 0;
#endif
set_cache_obj_fingerprint(cache_obj);
return cache_obj;
}

/** remove the object from the built-in doubly linked list
*
* @param head
Expand Down
3 changes: 3 additions & 0 deletions libCacheSim/dataStructure/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
add_subdirectory(hash)
add_subdirectory(test)

set(source
pqueue.c
splay.c
Expand All @@ -7,6 +9,7 @@ set(source
hash/murmur3.c
hashtable/chainedHashtable.c
hashtable/chainedHashTableV2.c
hashtable/cChainedHashTable.c
)
add_library (dataStructure ${source})

Loading
Loading