[SoC][Act]Concurrency library

For the past month or so I've been working on a concurrency library which brings active types, atomic types, and parallel loop constructs and algorithms to C++. I am familiar with some of the concurrency projects already underway, though I'm sure my library would be able to coexist. I plan on proposing through SoC sometime later this week. Over the past two days I've also begun writing up some documentation using QuickBook to give a general idea as to the design of the library. Though I do have a lot of features already implemented, there is still a very large amount of work to be done prior to completion. Some feedback before I make the formal proposal would be nice, and it'd also be great to see if anyone is interested. Keep in mind that the documentation is only a rough outing and so there are a few unconnected links, but I do include a brief introduction and some basic usage examples including code snippets. The library is reference to as Surge.Act as that is the namespace I use for my personal libraries, though it will of course be changed to Boost.Act if it were to be accepted. http://members.gamedev.net/Rivorus/surge/html/index.html For those familiar with the concept of futures and are confused as to why they are not mentioned, I will be adding all of that information to the rationale over the upcoming few days. I also apologize for not having better code examples. -- -Matt Calabrese

On Sun, 30 Apr 2006 16:09:36 -0400, Matt Calabrese wrote
For the past month or so I've been working on a concurrency library which brings active types, atomic types, and parallel loop constructs and algorithms to C++. I am familiar with some of the concurrency projects already underway, though I'm sure my library would be able to coexist. I plan on proposing through SoC sometime later this week.
Over the past two days I've also begun writing up some documentation using QuickBook to give a general idea as to the design of the library. Though I do have a lot of features already implemented, there is still a very large amount of work to be done prior to completion. Some feedback before I make the formal proposal would be nice, and it'd also be great to see if anyone is interested. Keep in mind that the documentation is only a rough outing and so there are a few unconnected links, but I do include a brief introduction and some basic usage examples including code snippets. The library is reference to as Surge.Act as that is the namespace I use for my personal libraries, though it will of course be changed to Boost.Act if it were to be accepted.
http://members.gamedev.net/Rivorus/surge/html/index.html
For those familiar with the concept of futures and are confused as to why they are not mentioned, I will be adding all of that information to the rationale over the upcoming few days. I also apologize for not having better code examples.
Hi Matt - Are you proposing this as a project you would do as a student or that you are looking for someone else to help with? In either case, please add to the Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Google_Summer... If you are planning to submit this as a student proposal, you'll need to follow the instructions from here: http://code.google.com/soc/studentfaq.html Jeff

I'd be proposing the project as a student. I will be sending in a formal application through SoC later this week, though I thought I'd run the idea by the mailing list first to see if there is any interest. -- -Matt Calabrese

On Sun, 30 Apr 2006 18:20:46 -0400, Matt Calabrese wrote
I'd be proposing the project as a student. I will be sending in a formal application through SoC later this week, though I thought I'd run the idea by the mailing list first to see if there is any interest.
Excellent -- After my brief look at your docs, it looks very interesting to me -- so I would encourage you to go forward :-) Jeff

Hello Matt, Take a look at http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/atomics.h.txt and at http://www.hpl.hp.com/personal/Hans_Boehm/c++mm/ in general before you start. The first page describes the atomic library interface which we discussed in April at the Berlin meeting. A stable implementation of the proposed API would definitely be useful although this API may change later. I am also not sure how much can be achieved until compilers support the proposed memory model. Valentin Sunday, April 30, 2006, 9:09:36 PM, you wrote: MC> For the past month or so I've been working on a concurrency library which MC> brings active types, atomic types, and parallel loop constructs and MC> algorithms to C++. I am familiar with some of the concurrency projects MC> already underway, though I'm sure my library would be able to coexist. MC> I plan on proposing through SoC sometime later this week. MC> Over the past two days I've also begun writing up some documentation using MC> QuickBook to give a general idea as to the design of the MC> library. Though I do have a lot of features already implemented, there MC> is still a very large amount of work to be done prior to completion. MC> Some feedback before I make the formal MC> proposal would be nice, and it'd also be great to see if anyone is MC> interested. Keep in mind that the documentation is only a rough outing and MC> so there are a few unconnected links, but I do include a brief introduction MC> and some basic usage examples including code snippets. The library is MC> reference to as Surge.Act as that is the namespace I use for my personal MC> libraries, though it will of course be changed to Boost.Act if it were to be MC> accepted. MC> http://members.gamedev.net/Rivorus/surge/html/index.html MC> For those familiar with the concept of futures and are confused as to why MC> they are not mentioned, I will be adding all of that information to the MC> rationale over the upcoming few days. I also apologize for not having better MC> code examples. MC> -- MC> -Matt Calabrese MC> _______________________________________________ MC> Unsubscribe & other changes: MC> http://lists.boost.org/mailman/listinfo.cgi/boost Valentin Samko http://val.samko.info

Thanks, I will be looking into the interfaces provided. For clarity, atomic types in my library are currently all internally emulated with a thread-safe active type implementation using an immediate act model which automatically forces a wait prior to returning (see my linked doc in the original post for what active types and act model are specifically with respect to the library). Clearly this is not very efficient particularly for built-in types, but it is the simplest implementation to get up and running in a fairly portable manner which accounts for user-defined types with a well-defined active interface. That being said, the main goal of atomic types in my library (which is only a small part of the library) is to provide an easy way to create thread-safe user-defined types of any complexity, which serialize all operations upon them and are accessed through any interface provided by means described in the documentation. This allows programmers to create complex types and easily have a way to safely use instances of them by multiple threads at the same time and have the operations not return until the call completes as though all operations were atomic. Of course, for built-in types specifically, more efficient techniques can be used internally, but that is not of primary concern at this point. Really, the focus of the library is for the creation of parallel loops and active functions and active types, with atomic types provided as a simple adapter for active types. -- -Matt Calabrese

"Matt Calabrese" <rivorus@gmail.com> wrote in message news:2142b7510604301309w126c93e4vd7d0c922aa65f347@mail.gmail.com...
For those familiar with the concept of futures and are confused as to why they are not mentioned, I will be adding all of that information to the rationale over the upcoming few days. I also apologize for not having better code examples.
If you haven't done so already, be sure to look at Ion GaztaƱaga's implementation in the Boost Vault of Kevlin Henney's N1883 futures design. It is under active development. --Beman

On 5/1/06, Beman Dawes <bdawes@acm.org> wrote:
If you haven't done so already, be sure to look at Ion GaztaƱaga's implementation in the Boost Vault of Kevlin Henney's N1883 futures design. It is under active development.
--Beman
I'm aware of the futures in active development, though my library is unique with respect to other active function and active object implementations in that it avoids the concept of futures almost entirely, or rather, merges the concept of futures with the concept of a running asynchronous function (represented by an action in the library) and the concept of active objects as conceptual return types of asynchronous calls rather than "future" values. By that I mean in order to create an active function call, you merely instantiate an action, passing the function object and arguments to the constructor. Access to the return value is granted through the action indirectly with * and -> but the interface of the value is actually the associated active qualified form of the return type and so operations performed on it are all serialized and do not imply a wait, even for complex user-defined types. Basically, instead of futures, the return type is thought of as an active type whose thread is not created until operations on it are queued. This provides a superset of the functionality provided by futures as you can still get the "inactive" form of the return type and force a wait for any type, however such a loss of concurrency is not necessary for any type which has a well-defined active interface, including complex user-defined types. -- -Matt Calabrese
participants (4)
-
Beman Dawes
-
Jeff Garland
-
Matt Calabrese
-
Valentin Samko