Which Language Handles Thread Operations Better for File Manipulation?

  • Context: Comp Sci 
  • 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, can somebody write this program:

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 can someone write the program!

Homework Statement


Homework Equations


The Attempt at a Solution


Homework Statement


Homework Equations


The Attempt at a Solution

 
Last edited:
Physics news on Phys.org


What exactly is your question? "Help me out" is not a very specific request.

The problem described appears to basically be a funny way of saying "Demonstrate you know how to use a mutex". The file described is a resource which needs to be protected by a mutex. The threads perform operations on this resource which they should hold the mutex in order to perform.
 


my question was can someone write this program, I just finished this phat *** program last night and I still got two more to go