harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paulex Yang <paulex.y...@gmail.com>
Subject Re: portlib functionality
Date Fri, 07 Jul 2006 03:07:35 GMT
Tim Ellison wrote:
> (Apologies for the very late response, I'm way behind on my 'must
> respond' list)...
>
> Marina Goldburt wrote:
>   
>> Hi,
>>
>> As I see the main idea of the port library is " isolates all platform
>> specific knowledge to one area", as written at
>> "http://svn.apache.org/viewvc
>> /incubator/harmony/enhanced/classlib/trunk/doc/vm_doc/html/group__Port.html
>> ".
>>
>> However, I've noticed that the code for sig, thread and luni modules also
>> contain the platform-dependent code.
>> For example, Java_org_apache_harmony_luni_platform_OSFileSystem_unlockImpl
>> function contains:
>>          rc = UnlockFileEx ((HANDLE) handle, (DWORD) 0,
>> nNumberOfBytesToUnlockLow,
>> nNumberOfBytesToUnlockHigh, (LPOVERLAPPED) & overlapped);
>> Where the handle was produced by hyfile_open function. It will lead to
>> problems when somebody tries to replace the portlib with a
>> different implementation, that can use not os-handles.
>>
>> Will it make sense to extend the portlib functionality and move such
>> platform-dependent code from sig, thread, luni modules to the portlib?
>>     
>
> And the short answer is "yes".  The additional file system functionality
> such as file locking and memory mapping required by the (newly authored
> within this project) NIO code should be put into the port library.
>
> Paulex: is this this something you are considering?
>   
Yes, I'm working on the FileChannel completion, and my thought is to 
write platform dependent codes for mmap at first(I thought it is easier 
to be accepted, so that things can be moved forward), then propose a 
mmap related extension to portlib, and if it is accepted, refactor the 
codes. The current portlib's mmap API cannot meet the requirement of nio 
in several ways:
1. cannot map file in modes other than Copy-On-Write
2. cannot map part of file
3. cannot pick up the opened file descriptor as parameter

Will look at the file locking later...And I'm sure there are other 
things worthing evaluation to be portlib extension.
> Regards,
> Tim
>
>   


-- 
Paulex Yang
China Software Development Lab
IBM



---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message