# How to wait for a period in P4

**URL:** <https://forum.p4.org/t/how-to-wait-for-a-period-in-p4/551>\
**Category:** Uncategorized\
**Created:** [November 24, 2022, 7:29am UTC](https://forum.p4.org/t/how-to-wait-for-a-period-in-p4/551 "2022-11-24T07:29:52Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![ederollora](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.p4.org/ederollora/32/21_2.png) [@ederollora](https://forum.p4.org/u/ederollora)\
**Post date:** [November 30, 2022, 8:16am UTC](https://forum.p4.org/t/how-to-wait-for-a-period-in-p4/551/4 "2022-11-30T08:16:50Z")

</div>

Hi,

This is from andyfingerhut in this [thread](https://forum.p4.org/t/how-many-pipelines-does-v1model-have/313):

> By default, simple\_switch and simple\_switch\_grpc runs multiple threads. One thread runs ingress for all packets. There are 4 threads numbered 0…3 that run egress code for packets destined to different output ports, where packets destined to output port X run on thread (X % 4). Each of these threads on a Linux system typically runs on a separate CPU core, if your system has enough CPU cores available. See the function `start_and_return_` in this file: [behavioral-model/simple\_switch.cpp at main · p4lang/behavioral-model · GitHub](https://github.com/p4lang/behavioral-model/blob/main/targets/simple_switch/simple_switch.cpp)
> 
> Multiple threads is similar to running multiple pipelines, in that on a multi-core CPU there are physically separate CPU cores processing packets on different threads.

I guess it is possible that a packet can be processed a packet is being cloned. Not sure though why that would be an issue in your use case. Maybe you can explåin further.

Cheers,

---

_[View the full topic](https://forum.p4.org/t/how-to-wait-for-a-period-in-p4/551)._
