|
-
August 23rd, 1999, 05:01 PM
#1
File Locking for multiple threads and RMI
I have several threads running in different programs that will might try reading and writing to the same file at the same time. The best solution I could come up with was to write a small RMI semaphore server using the absolute path and file name as the key. Is there a simpler way to do this?? I'm not really even sure if it's necessary.
Thanks in advance,
Scott Moyer
Quicksand Development
-
August 24th, 1999, 10:29 AM
#2
Re: File Locking for multiple threads and RMI
hi,
You can do this by having a separate class that handles all the IO issues of that file. You can make the IO method calls from synchronized methods of your new IO class.
The other method is to use the synchronized keyword over your InputStream/OutputStream object
thanx,
devi prasad m.p.
Keep working hard!!!
Keep climbibg high!!!
-
August 24th, 1999, 10:37 AM
#3
Re: File Locking for multiple threads and RMI
hai,
Hope u had refered my prev answer. Before trying out that please check whether read, write, etc IO methods are already synchronized. If they are already synchronized, u don't have to do all those.
bye,
devi prasad m.p,
Keep working hard!!!
Keep climbibg high!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|