From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3915 invoked by alias); 16 Mar 2016 00:00:26 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 3738 invoked by uid 89); 16 Mar 2016 00:00:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:D*mit.edu, H*r:User, Hx-spam-relays-external:!Symantec, H*RU:!Symantec X-HELO: dmz-mailsec-scanner-2.mit.edu Received: from dmz-mailsec-scanner-2.mit.edu (HELO dmz-mailsec-scanner-2.mit.edu) (18.9.25.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 16 Mar 2016 00:00:18 +0000 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43]) (using TLS with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by (Symantec Messaging Gateway) with SMTP id 74.50.23316.702A8E65; Tue, 15 Mar 2016 20:00:07 -0400 (EDT) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id u2G007vR031237; Tue, 15 Mar 2016 20:00:07 -0400 Received: from [128.59.19.206] (dhcp6.cs.columbia.edu [128.59.19.206]) (authenticated bits=0) (User authenticated as ilyaraz@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id u2G005EA031148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 15 Mar 2016 20:00:06 -0400 To: cygwin@cygwin.com From: Ilya Razenshteyn Subject: std::async from C++11 does not work Message-ID: <56E8A202.4060600@mit.edu> Date: Wed, 16 Mar 2016 00:00:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-03/txt/msg00288.txt.bz2 Hi all, I'm trying to compile and run the below code. As a result, only one copy of "f" is being executed at a time, that is, no new threads are spawned. Does anyone know what's going on? cygwin 2.4.1, gcc 5.3.0, compilation options are "g++ test.cpp -o test -O3 -Wall -std=c++11 -lpthread". Ilya #include #include using namespace std; void f(int id) { for (int i = 0; i < 100000; ++i) { cout << id << endl; } } int main() { std::async(std::launch::async, &f, 1); std::async(std::launch::async, &f, 2); return 0; } -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple