l4m3rx/python-ping

single_ping blocks threading.Thread.join

Closed this issue · 1 comments

When using single_ping under a thread in the attached example usage (initial wrapper that is instantiated at self.ping_generator, access function, thread declaration), when a call is made to threading.Thread.join, single_ping blocks the call and continues to execute without end.

This is a fatal flaw with our software that needs to be fixed.

I am working with wrapping this software into a Kivy application to display ping information as it comes in on a graph (the main branch which works fine, for reference). Kivy needs to maintain control, and any function longer than O(1) causes frames to be dropped and a decrease in performance. Thus, I see only two solutions:

  1. Run _send and _recieve individually, which could cause lost packets.

This goes against the current design philosophy of this software, which provides single_ping as a higher level access function than _send and _recieve individually

  1. Execute the access function in my software under a thread.

Obviously, one of those two would be much easier than the other, and it frustrates me to no end that our software breaks python's threading functionality.

It would seem to be the call to _recieve within single_ping that blocks the threading.Thread.join functionality, specifically because of the while 1: and select calls.

I have since tried moving into tkinter instead of kivy.

It would seem that this issue was actually an issue with the kivy interpreter
on mac.

Closing this issue for now. If it comes up, I will re open it.