From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com [209.85.213.180]) by dpdk.org (Postfix) with ESMTP id 351B58E5C for ; Sat, 15 Aug 2015 08:47:25 +0200 (CEST) Received: by igbjg10 with SMTP id jg10so25658703igb.0 for ; Fri, 14 Aug 2015 23:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=9CGWyFr+wG86V3h0Vb/ZVd+5/mmh0Wgog+RUkU9BPEQ=; b=inPD+6fZfilFtTnvZyGPjbV/VDs70usKLvbe2FXOMqgmXy/IKNyGOiE5nC8K4CrlMR RviNrVGmbFqLGU/xZFKrZskvDp4igtkd5XVWbVoKMPOavJgkcW2HRXdgGWHmlZQp4fnV S1t/VZdHEKVsyI5XbGYkaRfWAQJ2iBRGuxek9cAaGD9RAonFFJx6Oy8Azdy8g8/QqKvl JiWJG9iJ5ZsnkEo2u4uvTLRuRhznGUut2vo2tYDJf5F0PAijesD4okOHrVfT12USvee1 dGQvE80WCzAqibBkrP9YDXvUJtIoYyurZv34NmJacVL9xGX62q12NuJg3+b2Dji/byQ8 7p2Q== X-Received: by 10.50.8.102 with SMTP id q6mr6499634iga.23.1439621244487; Fri, 14 Aug 2015 23:47:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.140.206 with HTTP; Fri, 14 Aug 2015 23:47:05 -0700 (PDT) In-Reply-To: <20150814101842.GB8916@bricha3-MOBL3> References: <20150814101842.GB8916@bricha3-MOBL3> From: Rajesh R Date: Sat, 15 Aug 2015 02:47:05 -0400 Message-ID: To: Bruce Richardson Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] Can pthread_create be called directly in a dpdk application? X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Aug 2015 06:47:25 -0000 On Fri, Aug 14, 2015 at 3:48 PM, Bruce Richardson < bruce.richardson@intel.com> wrote: > On Fri, Aug 14, 2015 at 06:13:46AM -0400, Rajesh R wrote: > > I am relatively new to dpdk. I could make the examples work. > > > > Now I am experimenting with a traffic measurement application which > capture > > packets using dpdk. The application requires few other threads apart from > > the rte_threads. > > If I put the code for thread creation (pthread_create()) before calling > > eal_rte_init and remote_launch, the rte_init/remote launch is not > > proceeding. But if I put the eal_rte_init()/remote_launch first it is > > working, but coee will wait there and would not proceed to the subsequent > > lines > > > > How to do it correctly? > > > > -- > Hi Rajesh > > there should be no issues with spawning extra threads using pthread_create > in > your application. Can you provide a few more specifics and perhaps > snippets of > code which exhibit the problem. For example, when spawning the threads > before > init and remote launch - can you clarify in what way it is "not > proceding"? Does > it do nothing, does it hang, does it crash etc.? Similarly, putting the > pthread later, where exactly does it wait? Does gdb show anything of > interest, > or show more specifics as to what the thread is waiting on? > > Regards, > /Bruce > Hi Bruce, Thanks for a quick reply. Sory it was my mistake. I realized I was doing the mistake of putting the pthread_join()/rte_eal_wait_lcore() before the next segment of code and the control was waiting there. Now by moving those waiting part to the end of the complete code I could make it work. It works in either ways, putting pthread_create() first or rte_eal_remote_launch() first. Thanks a lot. Regards Rajesh R