in reply to Perl/Tk vs Win32::SerialPort
Two problems , you're not passing arguments, which means you're using global variables ... argument passing is what its all about (see Re^4: Query the height of Tk::Text widget with word wrap)
The other thing is, use Thread::Queue, and then you can in one thread do only tk stuff (get data from inqueue, do stuff with it, put data on outqueue) and it the other thread you do the talking with the serial port, however many loops and blockiness and whatever you need ... (see Re: Win32::GUI window freezing, even with threading. (win32-gui-tk-thread-dequeue.pl, Thread::Queue::popnow/push))
This might help :) Re: Win32::GUI window freezing, even with threading. (win32-gui-tk-thread-dequeue.pl, Thread::Queue::popnow/push) + Re^4: Win32::GUI window freezing, even with threading. (Wrong solution), Re: Tk: Creating label in hash, Re: perl Tk thread help, Re: error on file open, Re^4: Query the height of Tk::Text widget with word wrap
Also, food for thought, tk serialport,site:perlmonks.org tk serialport -> Marrying Tk, threads and SerialPort - a COM port monitor, Re: Perl Tk and Threads
|
|---|