|
Boost Users : |
Subject: Re: [Boost-users] [boost-TLS] Thread Local Storage (TLS) Question
From: Igor R (boost.lists_at_[hidden])
Date: 2013-11-24 12:07:51
> I am using multiple threads for I/O operations. The issue I am having is
> joining these threads on the main thread. It appears that calling join() on
> a thread with TLS pointers, it results in a hang.
Could you provide a small self-contained repro, or at least show some code?
<...>
> Another thing to note is that when calling detach() on the thread, all of
> the threads execute properly and I get expected output. However, I need to
> call join() every x amount of threads due to OS limitations of how many
> threads can actually be created. I need to read about 5000 files so
> obviously I can't create 5000 threads as Windows maxes out at 700 I believe.
> I am reading files off of a RAID setup so I believe this is a situation that
> can benefit from multiple threads reading files.
Creating threads for i/o is not an efficient/scalable approach.
Consider using Boost.Asio instead (in particular, see the following
example http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/example/cpp03/windows/transmit_file.cpp)
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net