Comments (14)
I tried different things and it seems that putting the condition to height >=4 works.
maybe related to the fact that growable_array test uses u32 for key, which is covered by depth 4 tree.
And another question is, why is it that even if I fail only stress_concurrent I get 0 in total?
cs431/homework/doc/hash_table.md
Lines 62 to 67 in 518270e
If stress_concurrent is the only test that fails, then you will get 20. Can you confirm that your solution passes the earlier tests?
from cs431.
And how should I deal with trees of depth smaller than 4?
And even if the tree is of depth 4, at some point I have to free the heights 1, 2, 3.
So I think it causes a problem either way.
from cs431.
What we can say is that your drop implementation is incorrect. What you should do in deallocating a segment is take ownership from the segment, (with Atomic::{try_}into_owned
or Shared::{try_}into_owned
), loop through the inner array of the segments and free the next segments if it is really a segment.
That fact that your implementation does not pass when height is 1,2,3 suggests that the above process is not done correctly.
from cs431.
I see. Thank you!
But could it be that my get() implementation affects the correctness of drop? Given that the tags are modified in get()?
or are drop and get independent?
from cs431.
The purpose of drop is to prevent memory leaks, so if you don't implement anything for drop and your get is correct, it should pass the tests, assuming memory does not run out.
from cs431.
What if stress sequential fails because of invalid memory reference. Is it because of my drop implementation?
from cs431.
Mabye? Your get may also not getting to the proper node. If you are getting invalid memory reference even without deallocation, your get is problematic.
from cs431.
If I comment the drop function, I pass stress sequential, but in asan I get Memory Leak:
running 1 test
test stress_sequential ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.07s
Testing split_ordered_list stress_sequential with cargo --release, timeout 10s...
running 1 test
test stress_sequential ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.07s
Testing growable_array lookup_concurrent with cargo --release, timeout 10s...
running 1 test
test lookup_concurrent ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.24s
Testing split_ordered_list lookup_concurrent with cargo --release, timeout 10s...
running 1 test
test lookup_concurrent ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.38s
Testing growable_array insert_concurrent with cargo --release, timeout 10s...
running 1 test
test insert_concurrent ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 2.36s
Testing split_ordered_list insert_concurrent with cargo --release, timeout 10s...
running 1 test
test insert_concurrent ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 6.56s
Testing growable_array stress_concurrent with cargo --release, timeout 10s...
running 1 test
test stress_concurrent ... Test timed out: cargo test --release --test growable_array stress_concurrent
Testing split_ordered_list stress_concurrent with cargo --release, timeout 10s...
running 1 test
test stress_concurrent ... Test timed out: cargo test --release --test split_ordered_list stress_concurrent
Testing growable_array stress_sequential with cargo_asan, timeout 10s...
running 1 test
test stress_sequential ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.47s
Test failed: cargo_asan test --test growable_array stress_sequential
Testing split_ordered_list stress_sequential with cargo_asan, timeout 10s...
running 1 test
test stress_sequential ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 5 filtered out; finished in 0.50s
Test failed: cargo_asan test --test split_ordered_list stress_sequential
Score: 0 / 180
from cs431.
And even if the tree is of depth 4, at some point I have to free the heights 1, 2, 3.
Do you mean that the depth node of some leaf node is not the same as the height of the tree? When get
is finished, the leaf nodes' depth are all the same.
from cs431.
yes. But what I understood is that to drop the segments of the growable_array (without the leafs) I have to drop all heights from root.tag to height = 1.
Is this wrong?
from cs431.
That is correct.
from cs431.
My main problem here is why recursive drop causes invalid memory reference in stress sequential, if i don't restrict the recursivity with:
if height <= 3 {
return;
}
from cs431.
That would mean that you are doing drop incorrectly, and if there is the restriction you don't have a problem because we don't make tress of heights larger than 3.
from cs431.
I see. Thank you!
from cs431.
Related Issues (20)
- [Question] Unable to start the workspace on Coder HOT 1
- [Question] I get VALID?=timeout with full score log HOT 4
- [Lecture] Suggestion on teaching promising semantics HOT 1
- Optional Q&A session on June 5th (Wed)
- [Question] Understanding of access hazard & ABA hazard HOT 1
- Server rebooting scheduled (Jun 5, Wed, 10pm~) HOT 1
- [Question] zip is not installed on server HOT 2
- gg.kaist.ac.kr down for preparing for the final exam HOT 1
- [Question] find_harris_herlihy_shavit relaxed load for tag HOT 6
- [Question] Timeout on growable_array stress_concurrent with cargo_asan HOT 2
- [Question] How to get previous node of bucket sentinel? HOT 8
- [Question] Hazard Pointers: is it safe to protect a pointer to invalid memory? HOT 5
- [Question] Code lines for maintaining the invariants of stack/queue HOT 1
- [Question] About the problem of 2022 Fall HOT 2
- [Question] ordering in stack push for maintaining invariant HOT 1
- Final claim session on June 17th (Mon) HOT 4
- [Question] HW 7 reason for having atomicUsize type in hazard field HOT 2
- [Question] [HW7] Failed Basic Tests in hazard.rs HOT 3
- [Question] HW7 Dropping the Hazard Bag HOT 3
- [Question] Partial Points on HW7 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cs431.