Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #80322

Re: good reference on threads

From Lynn McGuire <lynnmcguire5@gmail.com>
Newsgroups comp.lang.c++
Subject Re: good reference on threads
Date 2021-06-11 14:13 -0500
Organization A noiseless patient Spider
Message-ID <sa0cki$hot$1@dont-email.me> (permalink)
References <s9u208$94h$2@dont-email.me> <cf233b93-519a-4987-ae48-7831b2d55179n@googlegroups.com> <s9uee1$bk0$1@dont-email.me> <iigkhbFcj8jU1@mid.individual.net>

Show all headers | View raw


On 6/11/2021 3:17 AM, Ian Collins wrote:
> On 11/06/2021 13:31, Lynn McGuire wrote:
>> On 6/10/2021 5:49 PM, Öö Tiib wrote:
>>> On Friday, 11 June 2021 at 00:59:52 UTC+3, Lynn McGuire wrote:
>>>> Is there a good reference on threads ? I would like to delegate the
>>>> writing of our binary file to a background thread if possible. Our
>>>> Win32 Windows desktop program is mostly MFC with about 450,000 lines of
>>>> C++ code.
>>>>
>>>> I do suspect that this is not doable, due to the nature of the data
>>>> being used for dialogs and such.
>>>
>>> Threads can be used in various ways. Making half million lines
>>> code-base  that  is not thread safe to use threads is quite painful
>>> trick to pull. "Not doable" is not what I've met, it is always "what it
>>> will cost". I would maybe study Boost.Asio as it has nice clear
>>> philosophy of how to use threads. Then the question will shift
>>> from "how to make multiple threads to concurrently use same
>>> data?" to "how to make seamless I/O between threads that all
>>> have their own data?".
>>
>> I already have threads that have their own data.  I guess that I should
>> have mentioned that.
>>
>> I want multiple threads to share the massive dataset that we use.  Very
>> tricky, I have tried sharing data between the threads and it was a 
>> disaster.
> 
> Well it very much depends on whether you have multiple writers.  If you 
> have a more readers than writers, std::shared_mutex is worth a look.

The problem is specifically too many writes slowing the user interface down.

Lynn

Back to comp.lang.c++ | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

good reference on threads Lynn McGuire <lynnmcguire5@gmail.com> - 2021-06-10 16:59 -0500
  Re: good reference on threads Öö Tiib <ootiib@hot.ee> - 2021-06-10 15:49 -0700
    Re: good reference on threads Öö Tiib <ootiib@hot.ee> - 2021-06-10 17:58 -0700
    Re: good reference on threads Lynn McGuire <lynnmcguire5@gmail.com> - 2021-06-10 20:31 -0500
      Re: good reference on threads Öö Tiib <ootiib@hot.ee> - 2021-06-10 20:31 -0700
        Re: good reference on threads "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-10 21:32 -0700
          Re: good reference on threads "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-10 21:33 -0700
      Re: good reference on threads Ian Collins <ian-news@hotmail.com> - 2021-06-11 20:17 +1200
        Re: good reference on threads Lynn McGuire <lynnmcguire5@gmail.com> - 2021-06-11 14:13 -0500
      Re: good reference on threads Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 14:03 +0300
        Re: good reference on threads Paavo Helde <myfirstname@osa.pri.ee> - 2021-06-11 15:19 +0300
        Re: good reference on threads "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-12 14:41 -0700
  Re: good reference on threads Lynn McGuire <lynnmcguire5@gmail.com> - 2021-06-10 22:03 -0500
    Re: good reference on threads "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-06-10 20:08 -0700
      Re: good reference on threads Lynn McGuire <lynnmcguire5@gmail.com> - 2021-07-01 22:27 -0500
        Re: good reference on threads "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2021-07-01 21:28 -0700
        Re: good reference on threads legalize+jeeves@mail.xmission.com (Richard) - 2021-07-27 01:21 +0000
    Re: good reference on threads Cholo Lennon <chololennon@hotmail.com> - 2021-06-12 23:06 -0300
      Re: good reference on threads Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-06-12 21:47 -0700
        Re: good reference on threads Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2021-06-12 21:49 -0700
    Re: good reference on threads legalize+jeeves@mail.xmission.com (Richard) - 2021-07-27 01:19 +0000
    Re: good reference on threads Bonita Montero <Bonita.Montero@gmail.com> - 2021-07-27 03:58 +0200

csiph-web