[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squid-dev
Subject:    Re: cvs commit: squid/src/fs/aufs aiops.c async_io.c
From:       Serassio Guido <guido.serassio () acmeconsulting ! it>
Date:       2005-04-25 21:36:02
Message-ID: 6.2.1.2.2.20050425230746.043b6d58 () imap ! acmeconsulting ! it
[Download RAW message or body]

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/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic