Re: [RTnet-developers] Ethernet IP
Brought to you by:
bet-frogger,
kiszka
From: Jan K. <jan...@we...> - 2011-02-08 15:56:09
|
On 2011-02-08 16:52, Anders Blomdell wrote: > On 02/08/2011 04:03 PM, Jan Kiszka wrote: >> On 2011-02-08 16:00, Anders Blomdell wrote: >>>>> The only other reason this could be "oops"ing is that I am reading and >>>>> writing on the same socket and your example does not. >>>> >>>> We do in a less trivial application in the field. No complains from my >>>> colleagues so far. >>> With raw sockets I have problems reading and writing from/to the same >>> socket >>> when done from different threads (on my todo list to track this down >>> some time >>> in the future), might this be the same problem? >> >> You mean one thread reads and another writes? Or both mixed? What kind of >> problems? > At least with one thread reading and one writing. > Some errno which I cant exctly recall (9x, something, might have been > EADDRINUSE, but I'm not sure). 98 == EADDRINUSE. But that's only thrown by UDP and TCP, not AF_PACKET. > My workaround was to read from the socket > with a timeout, that way I was able to do everything in one thread (yes, > I know it's not a long term solution). Maybe there is same race and some missing locking. I would be interested to hear more details / see a test case when you find some time. Thanks, Jan |