Re: thread polling for timestamp on socket's error queue doesn't wake up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2017-11-10 15:29 GMT-02:00, valdis.kletnieks@xxxxxx <valdis.kletnieks@xxxxxx>:
> That seems reasonable.  Under what conditions would you want to receive an
> event for a packet that you haven't actually sent?  And how would an event
> related to a non-sent packet even be generated?

Yes, I've sent the packet :-) and I want the event (the timestamp) to be
received in another thread because the thread which has sent the packet wants to
send more packets while the kernel flushes the send queue.

> Or are you referring to sending a packet from one thread, generating an
> event that is then being received by a different thread?  And you're surprised
> that having received it in the other thread, it's no longer available in the
> first thread?  How would you solve that, other than keeping a near-infinite
> queue of events "just in case another thread wanted it"? (Although this sounds
> like a "well, don't do that, then" type of problem...)

Only one thread is polling. Look at the code I've sent.

Compile without SEND_IN_SAME_THREAD, use strace, and check if the poll() call
returns in thread B after the packet is sent in thread A. Here it doesn't.

However, when I compile with SEND_IN_SAME_THREAD the poll() returns on every
packet sent.

-- 
Ricardo Biehl Pasquali

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux