Re: Squid-smp : Please discuss

From: Sachin Malave <sachinmalave_at_gmail.com>
Date: Fri, 9 Oct 2009 01:42:52 -0400

On Mon, Sep 14, 2009 at 6:43 AM, Amos Jeffries <squid3_at_treenet.co.nz> wrote:
>
> I think we should take this on-list so the others with more detailed knowledge can give advice in case I have my facts wrong about AsyncCalls...
>
> I mean some mutex/lock on AsyncCallQueue so the multiple threads can do  AsyncCallQueue::schedule(call) without pointer collisions with theTail and theHead, when they setup the first read of an accepted()'d FD.
>
> For example something like this...
>
> thread #1:
>   while ( <events to dial> ) {
>      queuedEventX.dial()
>   }

I think it is possible to have a thread , which will be watching
AsyncCallQueue, if it finds an entry there then it will execute the
dial() function.
can we separate dispatchCalls() in EventLoop.cc for that purpose? We
can have a thread executing distatchCalls() continuously and if error
condition occurs it is written in "error" shared variable..... which
is then read by main thread executing mainLoop....... in the same way
returned dispatchedSome can also be passed to main thread...

we need to lock the AsyncCallQueue using some locking mechanism. If
that is done, is there any other variable that also must be considered
?

And no need to create a separate thread for schedule(), as it is not
doing much computations there, main thread can handle it easily...

>
> thread #2:
>   while( <listening for new connections> ) {
>     newFD = accept()
>     readFromNewFd = new AsyncCallPointer...
>     AsyncCallQueue::schedule(readFromNewFd);
>   }
>
>
>>
>> Need some time for further analysis...........
>>
>> Thank you so much......
>>
>
> Amos
> --
> Please be using
>  Current Stable Squid 2.7.STABLE6 or 3.0.STABLE19
>  Current Beta Squid 3.1.0.13

--
Mr. S. H. Malave
Computer Science & Engineering Department,
Walchand College of Engineering,Sangli.
sachinmalave_at_wce.org.in
Received on Fri Oct 09 2009 - 06:08:31 MDT

This archive was generated by hypermail 2.2.0 : Fri Oct 09 2009 - 12:00:04 MDT