libftdi Archives

Subject: RE: : adding -threads to SWIG build step?

From: Vanheesbeke Stefaan <Stefaan.Vanheesbeke@xxxxxxxxxxxxxx>
To: "libftdi@xxxxxxxxxxxxxxxxxxxxxxx" <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Aug 2013 07:17:58 +0000
Xiaofan, 

I'm using python 2.7. 
I'm for sure are interested of building libftdi myself, but I'm not sure if the 
-threads fixes all my issues, it should help anyway, so I want to do a quick 
testdrive. 

The intention of -threads for swig is to release the cPython GIL 
(http://wiki.python.org/moin/GlobalInterpreterLock) on library calls. This 
means that the operating system will switch to another process/thread while 
waiting for the latency of the USB-communication. 
If using the command line option -threads, SWIG will use this mechanism for all 
calls. This can be fine-tuned in the input file for SWIG (.i). But like I said 
earlier, if I see a good enough benefit for my purpose, I can try to do this 
later on. 

If you can provide the compiled results with -threads for python 2.7, I can do 
my tests. I can come back to you later for compiling this myself if needed. I 
think I need only _ftdi1.pyd and ftdi1.py
(svhb1000ATgmailDOTcom)
 
Thanks


-----Original Message-----
From: Xiaofan Chen [mailto:xiaofanc@xxxxxxxxx] 
Sent: donderdag 22 augustus 2013 3:38
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: : adding -threads to SWIG build step?

On Tue, Aug 20, 2013 at 4:42 PM, Vanheesbeke Stefaan 
<Stefaan.Vanheesbeke@xxxxxxxxxxxxxx> wrote:
>  Is anyone using the python bindings for libftdi 1.x?
>
>  I want to use it with a multithreaded application in Python. But this 
> needs  the -threads options for the SWIG build step (release the 
> python GIL on library calls to the driver).
>
>  Can someone add this as an extra output to the build process (so an 
> extra directory appears with the -threads build)
>
>  I was able to test this on Linux successfully, but it's not possible 
> for me  to do the same on Windows. Very much appreciate if someone can 
> make a windows-build of libftdi-1.0 with the -threads added to swig.

I am not a Python expert but I have been able to build the Python binding under 
Windows. Which Python version are you using? What should I do to add  -threads 
option to Swig?

Or maybe you can tell me your problems when building libftdi Python bindings 
under Windows so that I can help you there?

--
Xiaofan

--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx

Current Thread