Changes between Initial Version and Version 2 of Ticket #13163


Ignore:
Timestamp:
Aug 22, 2017, 9:02:35 PM (5 years ago)
Author:
viboes
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13163

    • Property Owner set to viboes
    • Property Status newassigned
    • Property Component Nonethread
  • Ticket #13163 – Description

    initial v2  
    11Locally, we had code that previously built in CentOS 6.x, using a compiler circa from 2009 that does not support variadic templates / rvalue references:
    22
     3
     4{{{
    35gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
    46Copyright (C) 2010 Free Software Foundation, Inc.
    57This is free software; see the source for copying conditions.  There is NO
    68warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     9}}}
     10
    711
    812Without variadic templates / rvalue references boost provides a boost::thread's variable argument constructor that supports up to 9 arguments + thread main.  Sadly, the variadic implementation that is enabled when rvalue references + variadic arguments are supported is:
     13
     14{{{
    915        template<typename F, class ...ArgTypes>
    1016        static inline detail::thread_data_ptr make_thread_info(BOOST_THREAD_RV_REF(F) f, BOOST_THREAD_RV_REF(ArgTypes)... args)
     
    1723                );
    1824        }
     25}}}
     26
    1927
    2028In turn, this calls into the platform specific version of heap_new, which currently only supports up to a total of 4 arguments.  Locally, I have modified my boost version (e.g. boost/thread/pthread/thread_heap_alloc.hpp) to have this definition:
    2129
     30
     31{{{
    2232#if defined(BOOST_THREAD_PROVIDES_VARIADIC_THREAD)
    2333        template<typename T,typename... Args>
     
    2939...
    3040
     41}}}
     42
    3143While this is functional for my needs, obviously I think it (or something like it) should get into boost proper.  Moreover, not that it likely matters, but it would also be wise to support at least 10 arguments to heap_new, in the non-variadic variant, so that it supports the ubiquity of other use cases in boost::thread et al.
    3244