Hey Reed,
I haven't even looked at this stuff in forever, but I'm happy to
revisit if there's interest. I think the idea of some simple
datastructures is a good one. Of course, we should also keep in mind
that C++0x is going to have much better support for lock-free stuff
built in, and it may not be worth the effort. That said, I'm willing
to do some work if others are!
bjorn
On Jul 2, 2008, at 2:27 PM, Reed Hedges wrote:
>
>
> Hi Bjorn, I'm learning about what's available in different compilers
> in the way
> of atomic compare and swap (and other operations).
>
> Are you still working on this? It looks like you have C&S, for
> example, for OSX
> but not the others.
>
> I'd like to have some kind of lock free associative container, maybe
> a skip list
> or something, maybe just a linked list of key/value records, not
> sure yet, that
> transparently falls back on granular locking if there's no atomic
> C&S (one mutex
> per node) -- probably by making the user supply a mutex to the
> "atomic"
> functions (even if it doesn't get used on platforms that have atomic
> C&S).
>
> What do you think?
>
> Have you used ThreadSafeList much? How about the AsyncOperation queue?
>
> Finally, what kind of license were you planning to use for this code?
>
> Reed
>
> Bjorn Roche wrote:
> >
> >
> > Hey all,
> >
> > I've started a subversion repo here: http://liblf.xowave.com/.
> > <http://liblf.xowave.com/.> It is
> > publicly readable, and I'm happy to give people write access to
> folks
> > who want to contribute. It's pretty sloppy at the moment, but I
> think
> > it's a start.
> >
> > Here's a quick description of the files:
> >
> > Atomic.h - has atomic primitives for things needed in the rest of
> the
> > code. Conditional compiling should make this extensible to any
> > platform, but right now it works on Mac OS X and might be good
> enough
> > for Linux. I'd love to see the Linux side fixed up, not to mention
> > some windows work.
> >
> > Fifo.h - your basic non-blocking fifo. Generically typed. There is
> > also some old commented code that could be used as a blocking Fifo.
> >
> > Async.cc
> > Async.h - implement an asynchronous Queue of "operations" that can
> be
> > performed in a separate thread. Useful for reading from or to a file
> > in the background. A nice improvement on this would be an interface
> > for reclaiming completed operations.
> >
> > sleep.cc
> > sleep.h - just for short sleeps. Useful for testing and also the few
> > functions that "block".
> >
> > ThreadSafeList.h - a Queue that can (in theory) be edited from one
> > thread while iterated through in another.
> >
> > makefile - building and cleaning and running the test program. I
> > think this requires gmake.
> >
> > test.cc - some tests.
> >
> > bjorn
> >
> > -----------------------------
> > Bjorn Roche
> > XO Wave
> > Digital Audio Production and Post-Production Software
> > http://www.xowave.com <http://www.xowave.com>
> > http://blog.bjornroche.com <http://blog.bjornroche.com>
> > http://myspace.com/xowave <http://myspace.com/xowave>
> >
> >
>
>
>
-----------------------------
Bjorn Roche
XO Wave
Digital Audio Production and Post-Production Software
http://www.xowave.com
http://blog.bjornroche.com
http://myspace.com/xowave