deleting a file in java while uploading it in other thread

Posted by user369507 on Stack Overflow See other posts from Stack Overflow or by user369507
Published on 2010-06-17T17:24:40Z Indexed on 2010/06/17 23:13 UTC
Read the original article Hit count: 179

Filed under:
|
|
|

i'm trying to build a semi file sharing program, when each computer acts both as a server and as a client.

I give multiple threads the option to DL the file from my system.

also, i've got a user interface that can recieve a delete message.

my problem is that i want that the minute a delete message receieved, i wait for all the threads that are DL the file to finish DL, and ONLY than excute file.delete(). what is the best way to do it?

I thought about some database that holds > and iterate and check if the thread is active, but it seems clumsy. is there a better way? thanks

© Stack Overflow or respective owner

Related posts about java

Related posts about threads