Beman Dawes | 1 Aug 2005 02:39
Picon
Favicon
Gravatar

Re: [Serialization] Boost regression notification(2005-07-31)


"Douglas Gregor" <doug.gregor <at> gmail.com> wrote in message 
news:c9d9f5edd926cc1d7f2ab2228d9754bd <at> cs.indiana.edu...
>
> On Jul 31, 2005, at 12:00 PM, Douglas Gregor wrote:
> > 31 failures in 1 library:
>>   serialization (31)
>>
>> |serialization|
>>   test_class_info_load_text_warchive_dll:  vc-6_5
>>   test_const_load_fail1:  borland-5_6_4
>>   test_const_load_fail1_nvp:  borland-5_6_4
>>   test_const_load_fail2:  borland-5_6_4
>>   test_const_load_fail2_nvp:  borland-5_6_4
>>   test_const_save_fail1:  vc-6_5  vc-6_5-stlport  vc-7_0
>>   test_const_save_fail2:  vc-6_5  vc-6_5-stlport  vc-7_0
>>   test_const_save_fail3:  vc-6_5  vc-6_5-stlport  vc-7_0
>>   test_demo_fast_archive_dll:  vc-6_5
>>   test_demo_pimpl_dll:  vc-6_5  vc-7_0
>>   test_demo_portable_archive_dll:  borland-5_6_4  intel-win32-8_1
>> intel-win32-9_0
>>   test_demo_shared_ptr_dll:  vc-6_5  vc-7_0
>>   test_map_binary_archive_dll:  vc-6_5  vc-7_0
>>   test_map_text_archive_dll:  vc-6_5  vc-7_0
>>   test_map_text_warchive_dll:  vc-6_5  vc-7_0
>>   test_mult_archive_types_dll:  vc-6_5
>>   test_non_intrusive_binary_archive:  vc-8_0
>>   test_shared_ptr_132_xml_archive_dll:  intel-win32-8_1
>
> I've gone through and marked up all of these, except this one strange
(Continue reading)

Jason Hise | 1 Aug 2005 03:35

singleton and thread safety

I need to ensure that certain objects (specifically the policy bundles 
which manage singleton instances) are created in a thread-safe manner.  
First question:  Can two threads both initialize the same static 
variable if they pass through the same function at the same time?  Ex:

void foo (  )
{
    static Thing t;
}

Can t's constructor be called twice by two threads executing foo?

If so, I feel that I need to construct my policy bundles before 
execution enters main, a time when it is pretty much guaranteed that the 
application is operating in a single-threaded context.  I thought that 
this would be simple to do:  just write a class that calls the function 
with the static variable in its constructor and create a global instance 
of that class.  However, the standard appears to say that initialization 
of such global variables can happen after main is entered, so long as it 
happens before the global variable is used.  If the program starts 
spawning threads before the global variable is constructed I would still 
have the same problem.

How can I ensure that initialization is performed before main is 
entered?  If I cannot, is there some other way to make initialization of 
static variables thread-safe?  I cannot lock a mutex to manage this, 
because the mutex lives inside the threading policy instance and the 
threading policy instance lives in the policy bundle that I am trying to 
create in the first place.

(Continue reading)

Tom Brinkman | 1 Aug 2005 03:51
Picon

Review Schedule

I've started to compile the next review schedule.  Please contact me
if would like to be a review manager volunteer or have any other
thoughts about the schedule or the libraries.  I will try to get the
next batch of reviews started in the next month or soo.  I will post a
review wizard status report in the next couple of weeks.

Tom Brinkman
Review Wizard

reportbase <at> gmail.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Jonathan Turkanis | 1 Aug 2005 04:13

Re: singleton and thread safety

Jason Hise wrote:

> How can I ensure that initialization is performed before main is
> entered?  If I cannot, is there some other way to make initialization
> of static variables thread-safe?  I cannot lock a mutex to manage
> this, because the mutex lives inside the threading policy instance and the
> threading policy instance lives in the policy bundle that I am trying
> to create in the first place.

You might want to look at this thread:

http://tinyurl.com/9xe83

Jonathan

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Jason Hise | 1 Aug 2005 05:05

Re: singleton and thread safety

Jonathan Turkanis wrote:

>Jason Hise wrote:
>
>  
>
>>How can I ensure that initialization is performed before main is
>>entered?  If I cannot, is there some other way to make initialization
>>of static variables thread-safe?  I cannot lock a mutex to manage
>>this, because the mutex lives inside the threading policy instance and the
>>threading policy instance lives in the policy bundle that I am trying
>>to create in the first place.
>>    
>>
>
>You might want to look at this thread:
>
>http://tinyurl.com/9xe83
>
>Jonathan
>
That does indeed confirm that function-local statics are not initialized 
in a thread-safe manner on some current popular C++ compilers.  So to 
avoid the whole mess regarding the DCLP, the best approach would 
probably be eager initialization, before the program enters a 
multi-threaded context.  Is initializing from the constructor of a 
namespace-scope global enough to ensure this?

-Jason

(Continue reading)

Goncalo N M de Carvalho | 1 Aug 2005 08:35
Picon
Favicon

Re: [Serialization] Boost regression notification (2005-07-31)


> Looking at the output of the test, I don't even
> seeing an error. To 
> make things more interesting, the other vc-8_0
> tester isn't having any 
> problem. Ideas, anyone?
> 

I'm away so I can't run it manually and get the full
output. However, one must be aware that there are
plenty of vc8s (beta1, beta2 or whatever) out there.
For the sake of the argument my version of the
compiler is 14.00.50215.44.

Cheers,

Goncalo

		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Alex Mendes da Costa | 1 Aug 2005 10:41
Picon

Re: Proposed addition to the iterator library for iterating over all tuples.

Quick update: I currently have a partial (but working) implementation
of the cross_iterator.  I hope to have a preliminary submission ready
some time this week.

Alex

On 7/26/05, David Abrahams <dave <at> boost-consulting.com> wrote:
> Alex Mendes da Costa <alexmdac <at> gmail.com> writes:
> 
> > The iterator that I am proposing would provide the sequence (1,10),
> > (2,10), (1,20), (2,20).
> 
> Oh, you want a cross-product iterator.  Interesting idea.
> 
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> 
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Martin Bonner | 1 Aug 2005 11:49

Re: singleton and thread safety

----Original Message----
From: Jason Hise [mailto:chaos <at> ezequal.com]
Sent: 01 August 2005 02:35
To: boost <at> lists.boost.org
Subject: [boost] singleton and thread safety

> I need to ensure that certain objects (specifically the policy bundles
> which manage singleton instances) are created in a thread-safe manner.
> First question:  Can two threads both initialize the same static
> variable if they pass through the same function at the same time?  Ex:
> 
> void foo (  )
> {
>     static Thing t;
> }
> 
> Can t's constructor be called twice by two threads executing foo?

The standard is silent on the issue (because it doesn't address threading).
You would need to consult the documentation of each supported compiler.

I can't find the documentation for VC7.1, but looking at the generated code,
it appears that t's constructor CAN be called twice.

> If so, I feel that I need to construct my policy bundles before
> execution enters main, a time when it is pretty much guaranteed that
> the application is operating in a single-threaded context.  I thought
> that this would be simple to do:  just write a class that calls the
> function with the static variable in its constructor and create
> a global instance of that class.  However, the standard appears to 
(Continue reading)

Larry Evans | 1 Aug 2005 12:06

Re: Proposed addition to the iterator library for iterating over all tuples.

On 07/25/2005 07:16 PM, Larry Evans wrote:
[snip]
> I can see where this would be useful in forming cross product.
> If, instead of scalar elements in the tuples, the rows of matrix
> M1 and columns of matrix M2 were elements of these tuples, then
> you could simply apply zip_iterator to each of these and then
> multiply each element of that iterator and then accummulate
> that with plus and end up with matrix multiply!

Well, this *may* not be the most efficient method for
implementing matrix multiply ;)  My enthusiasm blinded
my common sense.  However, I've also got this wild idea
that maybe template metaprogramming could maybe transform
an matrix multiply expression written this way into a
more efficient method.  David (Abrahams), does this
seem at all possible?  I recall you were considering
some sort of template library dealing with matrices
or linear algebra or something of that sort.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Andreas Huber | 1 Aug 2005 12:32
Picon
Favicon

[mpl] as_sequence< X< Y > > instantiates typedefs in X< Y >

Hi there

I'm trying to address a point raised by Jonathan Turkanis during the 
formal review of the statechart library. Basically, the problem boils 
down to the following:

#include <boost/mpl/list.hpp>
#include <boost/mpl/size.hpp>
#include <boost/mpl/as_sequence.hpp>

namespace mpl = boost::mpl;

// InnerInitial is either an mpl sequence of types or a single type
template< class InnerInitial >
struct state
{
  // stateArray_ must have a length equal to the number of types
  // in InnerInitial
  int stateArray_[
    mpl::size<
      typename mpl::as_sequence< InnerInitial >::type
    >::type::value
  ];
};

// A is defined later, possibly in a different translation unit
struct A;

template< class X >
struct B
(Continue reading)


Gmane