From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 7B6EF558A for ; Tue, 8 Nov 2016 18:04:48 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP; 08 Nov 2016 09:04:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,462,1473145200"; d="scan'208";a="28924550" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 08 Nov 2016 09:04:46 -0800 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 8 Nov 2016 09:04:46 -0800 Received: from fmsmsx113.amr.corp.intel.com ([169.254.13.90]) by fmsmsx101.amr.corp.intel.com ([169.254.1.27]) with mapi id 14.03.0248.002; Tue, 8 Nov 2016 09:04:46 -0800 From: "Wiles, Keith" To: David Aldrich CC: "users@dpdk.org" Thread-Topic: [dpdk-users] Is DPDK compatible with C++11 threads? Thread-Index: AdI5wJ4DFyR6sAaXS9+lshx5rT4LrAAZKUEA Date: Tue, 8 Nov 2016 17:04:45 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.3.131] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-users] Is DPDK compatible with C++11 threads? X-BeenThere: users@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: usage discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2016 17:04:48 -0000 > On Nov 8, 2016, at 5:12 AM, David Aldrich wr= ote: >=20 > Hi >=20 > As a beginner with DPDK, I want to consider how we can convert an existin= g Linux application from using the kernel network stack to using DPDK. >=20 > This existing app is multi-threaded, using the C++11 thread, mutex etc. c= lasses. We assign threads to cores by calling pthread_setaffinity_np(). >=20 > I have looked at the DPDK helloworld application and see that it launches= threads using the DPDK API: >=20 > /* call lcore_hello() on every slave lcore */ > RTE_LCORE_FOREACH_SLAVE(lcore_id) { > rte_eal_remote_launch(lcore_hello, NULL, lco= re_id); > } >=20 > If we use DPDK, can we retain our existing C++11 threads or are we oblige= d to use the DPDK threading APIs exclusively? You should be able to use the standard C++11 threads I believe, in DPDK we = are just using pthreads and set affinity to lock a thread to a core. You ca= n still use pthreads in your application. >=20 > Perhaps a more basic question is applicable: is DPDK compatible with C++? I believe building DPDK with C++ code does work, but I have not tried it m= yself. >=20 > Best regards >=20 > David >=20 >=20 >=20 > Best regards >=20 > David >=20 Regards, Keith