🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.c
Article #309619

Re: Szukam przykładu thread_pool

#309619
From: Borneq
Date: Sun, 14 Jan 2018 19:57
10 lines
1418 bytes
W dniu 14.01.2018 o 20:44, Borneq pisze:
> Biorę implementację z https://github.com/progschj/ThreadPool
> wpisuje do puli za pomocą emplace_back
> potem odpytuję:
>      for (auto &&result : results)
>          std::cout << result.get() << std::endl;

Przykładowo: chcę by liczby 1,2 i 5 były dodawane do globalnego wektora 
od razu gdy task się skończy. Wtedy musiałaby być podawana referencja do 
tego wektora do tych tasków oraz muteksy. Jak to mogło by wyglądać?
Technical Details
Message-ID: <p3gcmj$ohf$1@node2.news.atman.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
References: <p3d0dt$k1h$1@node2.news.atman.pl> <p3gbu6$nqa$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!newsfeed2.atman.pl!newsfeed.atman.pl!.POSTED!not-for-mail
From: Borneq <borneq@antyspam.hidden.pl>
Newsgroups: pl.comp.lang.c
Subject: Re: Szukam przykładu thread_pool
Date: Sun, 14 Jan 2018 20:57:07 +0100
Organization: ATMAN - ATM S.A.
Lines: 10
Message-ID: <p3gcmj$ohf$1@node2.news.atman.pl>
References: <p3d0dt$k1h$1@node2.news.atman.pl> <p3gbu6$nqa$1@node2.news.atman.pl>
NNTP-Posting-Host: public-gprs352921.centertel.pl
Mime-Version: 1.0
X-Trace: node2.news.atman.pl 1515959827 25135 37.47.9.218 (14 Jan 2018 19:57:07 GMT)
X-Complaints-To: usenet@atman.pl
NNTP-Posting-Date: Sun, 14 Jan 2018 19:57:07 +0000 (UTC)
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2
In-Reply-To: <p3gbu6$nqa$1@node2.news.atman.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit