Creating Threads in Java or C++: Balancing Writing and Deleting in Shared Files

  • Context: C/C++ 
  • Thread starter Thread starter kings1703
  • Start date Start date
  • Tags Tags
    C++ Java Threads
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
kings1703
Messages
4
Reaction score
0
Java or C++ - Threads HELP!

I need help with this program. I got five others to do and I won't have time to do it and it's apart of my final exam for next Tuesday, so here is my question I need:

Create 5 threads which share a file and
let "even" threads write to a file, and let "odd" delete from a file.
Cycle 5 threads for 10 times. Make sure final file gives correct output. (no race conditions)

Please help me out!
 
Physics news on Phys.org