Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Piggypack Encoding/Decoding on RandomAccessFile Date: Sat, 5 Nov 2011 13:25:52 -0700 (PDT) Organization: http://groups.google.com Lines: 29 Message-ID: <15411437.374.1320524752416.JavaMail.geo-discussion-forums@prmu13> References: <29284695.78.1320512625961.JavaMail.geo-discussion-forums@prok29> Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 173.164.137.213 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1320524752 30377 127.0.0.1 (5 Nov 2011 20:25:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 5 Nov 2011 20:25:52 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.213; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:9599 Jan Burse wrote: > Lew schrieb: > > This has been a very interesting question and > > ensuing thread. I've seen this sort of multiple > > interaction (conflict) of resource clients a couple > > of times but most of those cases were unintentional > > and considered bugs. > > If you open the raf with mode "r" no such issues > pertain. If you open the raf with mode "rw" then > of course you have an update problem if multiple > threads access the raf, not to speak what happens > accross processes. Not true. Two clients reading from the same file descriptor interact with each other as you yourself have discussed extensively upthread. This isn't about update of the file, it's about update of the descriptor. It's also not about threads at all. > But the channel also offers locks. You can even > parameterize them by ranges. And they are even > synchronized accross processes. It happens that I > have used the locks for byte based access, but I > guess they are also useful when a character reader/ > write is placed on the byte stream. Interesting but not relevant to my point. -- Lew