They're very unsafe, and it gets really complicated to make them
both highly performant and thread safe, and like Ted says: just synchronize
at a higher level.  You're never dealing with one Vector and want to max out
all 8 cores on that one vector, you're looking at millions of vectors - give
1/8th to each core, and don't bother with making them threadsafe in the
first place.

But we should probably document them all as being thread unsafe (although
anyone familiar with usual collections knows that unless you have special
purpose concurrent/syncrhonized collections, they're not thread safe).

On Fri, Apr 19, 2013 at 11:32 AM, Robin Anil <[email protected]> wrote:

> Yes, that may be a better approach. Do we in any part of our code share the
> vectors across threads? Our Vector implementations are thread-unsafe. Maybe
> making it threadsafe or having a threadsafe version maybe one more thing we
> can build.
>
> Robin Anil | Software Engineer | +1 312 869 2602 | Google Inc.
>
>
> On Thu, Apr 18, 2013 at 6:37 PM, Ted Dunning <[email protected]>
> wrote:
>
> > On Thu, Apr 18, 2013 at 1:41 PM, Robin Anil <[email protected]>
> wrote:
> >
> > > 4) Parallelize operations: Use a consistent sharding function to
> > trivially
> > > parallelize certain iterative operations across multiple threads.
> > >
> >
> > I have done this with good results, but I find it is usually better to
> > thread higher up the stack because coarse threading is often easier than
> > fine grain threading.
> >
>



-- 

  -jake

Reply via email to