Re: Squid-smp : Please discuss

From: Adrian Chadd <adrian_at_squid-cache.org>
Date: Tue, 15 Sep 2009 16:13:42 +1000

If you want to start looking at -threading- inside Squid, I'd suggest
thinking first how you'd create a generic thread "helper" framework
that allows Squid to run multiple internal threads that can do
"stuff", and then implement some message/data queues and handle
notification between threads.

You can then push some "stuff" into these worker threads as an
experiment and see exactly what the issues are.

Building worker threads into Squid is easy. Making them do anything?
Not so easy :)

Adrian

2009/9/15 Sachin Malave <sachinmalave_at_gmail.com>:
> On Tue, Sep 15, 2009 at 1:38 AM, Adrian Chadd <adrian_at_squid-cache.org> wrote:
>> 2009/9/15 Sachin Malave <sachinmalave_at_gmail.com>:
>>> On Tue, Sep 15, 2009 at 1:18 AM, Adrian Chadd <adrian_at_squid-cache.org> wrote:
>>>> Guys,
>>>>
>>>> Please look at what other multi-CPU network applications do, how they
>>>> work and don't work well, before continuing this kind of discussion.
>>>>
>>>> Everything that has been discussed has already been done to death
>>>> elsewhere. Please don't re-invent the wheel, badly.
>>
>>> Yes synchronization is always expensive . So we must target only those
>>> areas where shared data is updated infrequently. Also if we are making
>>> thread then the amount of work done must be more as compared to
>>> overheads required in thread creation, synchronization & scheduling.
>>
>> Current generation CPUs are a lot, lot better at the thread-style sync
>> primitives than older CPUs.
>>
>> There's other things to think about, such as lockless queues,
>> transactional memory hackery, atomic instructions in general, etc,
>> etc, which depend entirely upon the type of hardware being targetted.
>>
>>> If we try to provide locks to existing data structures then
>>> synchronization factor will definitely affect to our design.
>>
>>> Redesigning of such structures and there behavior is time consuming
>>> and may change whole design of the Squid.
>>
>>
>> Adrian
>>
>
>
>
> And  current generation libraries are also far better than older, like
> OpenMP, creating threads and handling synchronization issues in OpenMP
> is very easy...
>
> Automatic locks are provided, u need not to design your own locking
> mechanisms........ Just a statement and u can lock the shared
> variable...
> Then the major work remains is to identify the shared access.....
>
> I WANT TO USE OPENMP library.............
>
> ANY suggestions.....
>
>
Received on Tue Sep 15 2009 - 06:13:51 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 15 2009 - 12:00:05 MDT