directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Wallace <rwall...@thewallacepack.net>
Subject Re: OT: Psuedo Async File IO
Date Sat, 09 Apr 2005 19:55:49 GMT
The try lock method is for getting an exclusive lock on a file.  It has 
nothing to do with the actual reading or writing of the file, other than 
disallowing other threads or processes from opening the file and reading 
or writing it.

Rich

Emmanuel Lecharny wrote:
> Hi,
> 
> can't you use the FileChannel's tryLock() method?
> (http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/FileChannel.html#tryLock(long,%20long,%20boolean))
> 
>  
> 
> On Fri, 2005-04-08 at 22:38 -0700, Richard Wallace wrote:
> 
>>Java NIO doesn't support non-blocking file IO.  Only non-blocking socket 
>>IO.  If you look you'll see that the FileChannel does not extend the 
>>SelectableChannel and so cannot be set to non-blocking mode or 
>>registered with a selector.
>>
>>Ben Walding wrote:
>>
>>>Am I confused, or is Java NIO not what you're looking for?
>>>
>>>http://java.sun.com/j2se/1.4.2/docs/guide/nio/
>>>
>>>Mike Spille wrote some wrappers around NIO, but I'm not sure how active 
>>>they are:
>>>
>>>http://sourceforge.net/projects/pyrasun/
>>>
>>>Richard Wallace wrote:
>>>
>>>
>>>>Hey everyone,
>>>>
>>>>I'm getting to a point with my smtp protocol provider that I need to 
>>>>start thinking about file IO.  Since there is no support for 
>>>>non-blocking IO in Java yet I need something that fakes it.  I was 
>>>>wondering if anyone had any experience with any existing components 
>>>>that do this.  If there aren't any really good ones that anyone can 
>>>>recommend I'll probably wind up writing something on my own.
>>>>
>>>>I'm kind of thinking it should basically be a component that uses a 
>>>>single thread to monitor a queue for IO requests and then uses 
>>>>something like the IoHandler in MINA to let clients know when 
>>>>reads/writes have started/stopped/failed.
>>>>
>>>>Any input on existing components or what would be necessary to maybe 
>>>>repurpose parts of MINA for this task would be great.
>>>>
>>>>Thanks,
>>>>Rich
>>>>
>>>
> 
> 

Mime
View raw message