Re: Yet another _ATL_FREE_THREADED question
Are you testing with single reader and single writer? Then you'd
be seeing only the top of the iceberg. The benefit scales with
the number of concurrent accesses. That said, however, with
a single core / single CPU you won't see great benefit either.
You need to go to multi-core multi-CPU environment to realize
the full benefits of parallelization.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================
"Dilip" <rdilipk@lycos.com> wrote in message
news:1150338969.081115.214190@y41g2000cwy.googlegroups.com...
Alexander Nickolov wrote:
I think you have. Now for the million dollar question - what
improvement did you expect that you are not observing? If
you synchronize all method calls on a single mutex upon entry,
your server will not behave any faster than a single-threaded
server.
You got to give me some credit :-) I understand that fully well and
have tried to establish my locks as fine grained as possible -- just at
the right spot and not any earlier (BTW, I dont use any mutexes -- only
CRITICAL_SECTION). I am unable to talk about the performance
improvement (or the lack thereof) without describing a fair amount of
stuff in detail. In any case I am not sure if anyone is interested in
wading through all that crap.
But to put it in a nutshell -- I have a std::map that is stuffed with a
string/complexstructure (key/value) pair. On one end clients keep
pumping data into the server (basically inserting/updating elements in
that map).. on another end other clients repeatedly read stuff from the
same map. so the map and the values stuffed in it need to be
protected.
Earlier when the server was naively built with STA, I expectedly saw
some atrocious timings -- that is to retrieve, lets say, 10 elements
repeatedly for about 30,000 times yielded me nearly 266 seconds when
both the pumping and retrieval operations are simultaneously happening
on both ends. After converting it to MTA and carefully placing the
locks in the right places I saw the timing plummet to around 150
seconds.
What I can't make up my mind on is have I reached the magic figure or
can I still do better.