Hi Henrik,
At 22.45 25/04/2005, Henrik Nordstrom wrote:
>On Mon, 25 Apr 2005 serassio@squid-cache.org wrote:
>
>> - Usage of FD_READ_METHOD/FD_WRITE_METHOD instead of read()/write() int the
>> async-io completion event for better portability.
>
>Note: FD_READ/WRITE_METHOD relies upon the fd_table, which the async-io
>threads intentionally is/was kept from using. Not sure if it is a good
>thing to make the async-io threads dependent on the fd_table.
This is an interesting question.
On platforms where there is equivalence of Pipe, File and Socket Handles
and read()/write() can be used in place of recv()/send() its possible have
the async-io threads independent from the fd_table.
But when the equivalence is not available, things becomes more complex.
When using read() or write() is mandatory to use a function wrapper that
looks into fd_table for select the correct function call to use. This cause
a significative overhead.
Thinking again about this, could be a good solution save the function
pointer to FD_WRITE_METHOD/FD_READ_METHOD after the done pipe
initialization, and use this function pointer into threads code to call the
correct function call, without any other lookup into fd_table and without
significative overhead.
Regards
Guido
-
========================================================
Guido Serassio
Acme Consulting S.r.l. - Microsoft Certified Partner
Via Lucia Savarino, 1 10098 - Rivoli (TO) - ITALY
Tel. : +39.011.9530135 Fax. : +39.011.9781115
Email: guido.serassio@acmeconsulting.it
WWW: http://www.acmeconsulting.it/
Received on Mon Apr 25 2005 - 15:36:25 MDT
This archive was generated by hypermail pre-2.1.9 : Sun May 01 2005 - 12:00:06 MDT