Comments (4)
@Blazefrost True. Stack separation should be covered. How about testing the shared data segment as well? If you like you could also implement Dekker's algorithm to see if that works (no atomics required).
from selfie.
After second thought, I think it should be fine. The main thread creates a second one, but immediately joins with it:
selfie/grader/assignments/threads/shared-heap.c
Lines 17 to 19 in 9b97426
Only the second thread will call malloc
, assign a value to the allocated memory, and exit:
selfie/grader/assignments/threads/shared-heap.c
Lines 19 to 23 in 9b97426
However, I'm open for recommendations of new tasks. I thought about creating a test whether the stacks are properly separated using some conditional nested function calls, depending on the thread ID, but the procedure prologue of the syscalls probably has this case covered already, otherwise the code to check would have a problem with the return address.
from selfie.
There's already the shared-data.c check for the shared data section.
I've now implemented a check that sums up all integers from 1 to 20 and used Dekker's algorithm for the critical section. This additional check is able to check shared data/heap sections (due to the sum variable and Dekker's algorithm control variables) as well as distinct stacks (due to calls to enter/leave critical sections) in PR #247.
from selfie.
@Blazefrost Awesome! Thanks a lot.
from selfie.
Related Issues (20)
- 11) Virtualization - Introductory Assignments
- Compiler warnings with GCC 10.2.0 HOT 3
- Docker Build on Mac
- Clean up gcc/clang toolchain in Dockerselfie image to support 32-bit and 64-bit x86 and RISC-V HOT 10
- `self-assembler` assignment results in timeout HOT 7
- ELF file integrity
- Suggestion: -Werror when self-grading HOT 7
- `characters of assembly` count in disassembler output is incorrect in `printf` branch HOT 10
- Grader not terminating on plain selfie HOT 4
- Order in list of assignments out of sync HOT 1
- Inconsistent handling of unexpected symbol syntax errors HOT 4
- Compiler warnings with GCC 11.1.0 HOT 4
- Residual files in selfie root directory in the selfie docker image after machine build HOT 1
- Multiplatform AMD64/ARM64 Support HOT 2
- "palloc out of physical memory" problem with changed "make os" HOT 7
- modeler returns "maximum code size exceeded" or "4712 expected between -4096 and 4095" if code size is increased HOT 7
- 32-bit + mipster + self-self-self [+ gc] is failing HOT 1
- Naming the programming language C* causes some confusion HOT 1
- Collisions between student code and Rotor [cc24] HOT 5
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 selfie.