Ticket #62 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

Python threading

Reported by: ObsidianX Owned by: dsmith
Priority: critical Milestone: Version 0.6.00
Component: other Version: 0.6.00
Keywords: python thread Cc:

Description

As of right now the search/connect code blocks the entire app upon execution. In an app such as mine that needs to be looking for wiimotes constantly while doing its normal operation, this is unacceptable. Thanks to someone in the Python IRC channel I found info on proper Python C threading and hacked up the module code to make it cooperate with my thread.

The only thing that needed to be done was to wrap the connect code with the macros: Py_BEGIN_ALLOW_THREADS Py_END_ALLOW_THREADS

As you will see in the patch.

Attachments

pythread.patch (438 bytes) - added by ObsidianX 4 years ago.
threading patch

Change History

Changed 4 years ago by ObsidianX

threading patch

  Changed 4 years ago by dsmith

  • status changed from new to assigned

nice work - I'll commit as soon as I have a chance

follow-up: ↓ 3   Changed 4 years ago by dsmith

  • status changed from assigned to closed
  • resolution set to fixed

in reply to: ↑ 2   Changed 3 years ago by news1234

Replying to dsmith: Thanks a lot for this patch. I just got the same suggestions from a python friend and saw then, that ou made this patch already.

It works as expected :-)))

Note: See TracTickets for help on using tickets.