Thank you very much for your reply. However, after the socket is set to the non blocking mode, the CPU utilization rate is always 100%. The resource consumption is very high when multithreading. I can only reduce the CPU utilization rate by using methods such as select.
Why does this mode fail in blocking mode? Do you have any ideas? Florin Coras <fcoras.li...@gmail.com> 于2022年9月8日周四 02:06写道: > Hi, > > Just tested on master and this seems to work fine after a few app fixes. > Having said that, I would recommend you build vcl native apps and register > multiple workers for better performance. > > Comments: > - make sure sockets are not blocking otherwise there’s a good change that > only one of the threads will output something > - only print a message if data was received > > See diff here [1]. > > Example output, with 2 clients (c1 and c2) and updated ips. > > [snip] > vppcom_session_create:1410: vcl<233836:0>: created session 1 > ldp<233836>: fd 33: calling vls_bind: vlsh 1, addr 0x7ffd7d7cf750, len 16 > vppcom_session_bind:1599: vcl<233836:0>: session 1 handle 1: binding to > local IPv4 address 7.0.0.2 port 12342, proto UDP > vppcom_session_listen:1628: vcl<233836:0>: session 1: sending vpp listen > request... > vcl_session_bound_handler:569: vcl<233836:0>: session 1 [0x0]: listen > succeeded! > ldp<233836>: fd 33 vlsh 1, cmd 4 > > [recv from 7.0.0.1:60414]c1 s1 > > [recv from 7.0.0.1:56760]c2 s1 > > [recv from 7.0.0.1:56760]c2 s2 > > [recv from 7.0.0.1:60414]c1 s2 > > > Regards, > Florin > > [1] https://pastebin.com/4LCukbEC > > > On Sep 7, 2022, at 12:05 AM, nengjie wang <moho.man...@gmail.com> wrote: > > > > The attachment is my server program. > > > > My VPP version is 22.06. When I start this server by LDP and send a > request to this server, the server will have a direct segment error. Two > threads share an event queue, resulting in an event queue crash. Can you > tell me if LDP does not support this use? > > > > In addition, I noticed that there is a configuration item called ‘muti > thread workers’ in the VCL configuration file. When this configuration is > turned on, the program can not receive RPC response. Is it suitable for me > to use this configuration item in this case? > > <udp_recv.c> > > > > > > > > >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#21927): https://lists.fd.io/g/vpp-dev/message/21927 Mute This Topic: https://lists.fd.io/mt/93520105/21656 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/leave/1480452/21656/631435203/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-