DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] Thread preemption and rte_ring
@ 2013-11-05 10:46 Dmitry Vyal
  2013-11-05 15:26 ` Olivier MATZ
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Vyal @ 2013-11-05 10:46 UTC (permalink / raw)
  To: dev

Hello,

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? 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?

Thanks,
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] Thread preemption and rte_ring
  2013-11-05 10:46 [dpdk-dev] Thread preemption and rte_ring Dmitry Vyal
@ 2013-11-05 15:26 ` Olivier MATZ
  0 siblings, 0 replies; 2+ messages in thread
From: Olivier MATZ @ 2013-11-05 15:26 UTC (permalink / raw)
  To: Dmitry Vyal; +Cc: dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-11-05 15:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-05 10:46 [dpdk-dev] Thread preemption and rte_ring Dmitry Vyal
2013-11-05 15:26 ` Olivier MATZ

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).