From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 04E25593D for ; Tue, 5 Nov 2013 16:25:40 +0100 (CET) Received: by mail-wg0-f49.google.com with SMTP id x12so3697722wgg.16 for ; Tue, 05 Nov 2013 07:26:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=IEQVk6exklz+tkU/jSjSxz8mI9JNYLkif5603uIF17U=; b=dE+AcWbQIJrZ5D27PSXxk+CeyfpA1fJ6vaiLSVG42Azddn6EVb4mgkew/XDo2PAfJT s4/SNy0avOQmXUHPMv2pTb6FyNI9m68g++fv6fE5/KY1b+5JW4wRLAHCEs9r3ZQNMQP6 oFIi8wg3PQjehDkMKw+jNykA/CU6+DbCjQxUY7XvMbPz3KLbLPCW/WuA2r9xNDtzzAJi yVBhqi9Ks24AkjbK23GygZCgzsvfuHZ68AuftHEo9mSXZLMm67AL9BKM0biZBtbOor8+ nVjY4qe2M4HTZPuVFo9r2/G6gYE8mp4sSoyaqNghm/Yl9reRBHXlLcdk7KcwcviH/hKU dEQw== X-Gm-Message-State: ALoCoQnhqQNIdZDv0ZpHDk44o38BdxEh6Ts9VYCh3QoQyuEH8m2P/mR/ddNV1pdA2Pz4fZr27g/6 X-Received: by 10.180.24.137 with SMTP id u9mr17335162wif.5.1383665193964; Tue, 05 Nov 2013 07:26:33 -0800 (PST) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id y20sm15032393wib.0.2013.11.05.07.26.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 05 Nov 2013 07:26:33 -0800 (PST) Message-ID: <52790E27.4060103@6wind.com> Date: Tue, 05 Nov 2013 16:26:31 +0100 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131005 Icedove/17.0.9 MIME-Version: 1.0 To: Dmitry Vyal References: <5278CC7B.9040600@gmail.com> In-Reply-To: <5278CC7B.9040600@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] Thread preemption and rte_ring 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: Tue, 05 Nov 2013 15:25:41 -0000 Hello Dmitry, > Documentation for rte_ring says: the ring implementation is not > preemptable. A lcore must not be interrupted by another task that uses > the same ring. What does it precisely mean? Must all the producers and > consumers be non-preemptive? The "non-preemptive" constraint means: - a pthread doing multi-producers enqueues on a given ring must not be preempted by another pthread doing a multi-producer enqueue on the same ring. - a pthread doing multi-consumers dequeues on a given ring must not be preempted by another pthread doing a multi-consumer dequeue on the same ring. Bypassing this constraints may cause the 2nd pthread to spin until the 1st one is scheduled again. Moreover, if the 1st pthread is preempted by a context that has an higher priority (for instance a kernel thread), it can even cause a dead lock. > Can we relax that restriction somehow? Say, > can I have multiple non-preemptive writers running on dedicated cores > and a single reader running as a regular Linux thread? Yes, this should work. Regards, Olivier