Re: Interesting Thread Gotcha

2008-01-18 Thread Hendrik van Rooyen
Dan ther,,,ail.com wrote: Would it be possible to have pychecker (or some such) warn that there is an insufficient parameter count to start_new_thread? I guess that would require knowing the type of thread. . . I think this is the hub of the thing - its not only start_new_thread, but the

Re: Interesting Thread Gotcha

2008-01-17 Thread Sion Arrowsmith
Diez B. Roggisch [EMAIL PROTECTED] wrote: Of course start_new_thread could throw an error if it got nothing callable as first argument. No idea why it doesn't. It does: thread.start_new_thread(None, None) Traceback (most recent call last): File stdin, line 1, in ? TypeError: first arg must be

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
Bjoern Schliessmann usenet-ourmet.com wrote: Hendrik van Rooyen wrote: Absolutely! - well spotted! This is no threading problem at all; not even a syntax problem. If you don't know exactly what start_new_thread and kbd_driver functions do it's impossible to tell if your code does what is

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
Duncan Booth dunc...d.invalid wrote: Given that the start_new_thread function never actually got called, what code exactly do you expect to complain about the absence of a tuple? I don't understand this assertion. I thought that start_new_thread was called with a missing comma in its

Re: Interesting Thread Gotcha

2008-01-17 Thread Peter Otten
Hendrik van Rooyen wrote: Duncan Booth dunc...d.invalid wrote: Given that the start_new_thread function never actually got called, what code exactly do you expect to complain about the absence of a tuple? I don't understand this assertion. I thought that start_new_thread was called

Re: Interesting Thread Gotcha

2008-01-17 Thread Hendrik van Rooyen
Diez B. Roggisch dee,,eb.de wrote: Hendrik van Rooyen wrote: It would have been nice, however, to have gotten something like: TypeError - This routine needs a tuple. instead of the silent in line calling of the routine in question, while failing actually to start a new thread.

Re: Interesting Thread Gotcha

2008-01-17 Thread Peter Otten
Hendrik van Rooyen wrote: Bjoern Schliessmann usenet-ourmet.com wrote: Hendrik van Rooyen wrote: Absolutely! - well spotted! This is no threading problem at all; not even a syntax problem. If you don't know exactly what start_new_thread and kbd_driver functions do it's impossible to

Re: Interesting Thread Gotcha

2008-01-16 Thread Duncan Booth
Hendrik van Rooyen [EMAIL PROTECTED] wrote: It would have been nice, however, to have gotten something like: TypeError - This routine needs a tuple. instead of the silent in line calling of the routine in question, while failing actually to start a new thread. Given that the

Re: Interesting Thread Gotcha

2008-01-16 Thread Bjoern Schliessmann
Hendrik van Rooyen wrote: Absolutely! - well spotted! This is no threading problem at all; not even a syntax problem. If you don't know exactly what start_new_thread and kbd_driver functions do it's impossible to tell if your code does what is intended. It would have been nice, however, to

Re: Interesting Thread Gotcha

2008-01-16 Thread Diez B. Roggisch
Hendrik van Rooyen wrote: Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be keyboard_thread = thread.start_new_thread(kbd_driver, (port_q,kbd_q)) Commas are important! -Dan Absolutely! - well spotted! As the first

Re: Interesting Thread Gotcha

2008-01-16 Thread Dan
On Jan 16, 11:06 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be keyboard_thread = thread.start_new_thread(kbd_driver, (port_q,kbd_q)) Commas are

Re: Interesting Thread Gotcha

2008-01-16 Thread Diez B. Roggisch
Dan schrieb: On Jan 16, 11:06 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be keyboard_thread = thread.start_new_thread(kbd_driver, (port_q,kbd_q)) Commas are

Re: Interesting Thread Gotcha

2008-01-16 Thread Dan
On Jan 16, 1:33 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Dan schrieb: On Jan 16, 11:06 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be

Re: Interesting Thread Gotcha

2008-01-16 Thread Diez B. Roggisch
Dan schrieb: On Jan 16, 1:33 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote: Dan schrieb: On Jan 16, 11:06 am, Diez B. Roggisch [EMAIL PROTECTED] wrote: Hendrik van Rooyen wrote: Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be

Interesting Thread Gotcha

2008-01-15 Thread Hendrik van Rooyen
I thought I would share this nasty little gotcha with the group. Consider the following code fragment: start print 'starting kbd thread' keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) print 'starting main loop' error = Mainloop(s,port_q,active_q_list) end It produces, as

Re: Interesting Thread Gotcha

2008-01-15 Thread Dan
On Jan 15, 10:07 am, Hendrik van Rooyen [EMAIL PROTECTED] wrote: I thought I would share this nasty little gotcha with the group. Consider the following code fragment: start print 'starting kbd thread' keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) print 'starting

Re: Interesting Thread Gotcha

2008-01-15 Thread Hendrik van Rooyen
Dan the,,,ail.com wrote: keyboard_thread = thread.start_new_thread(kbd_driver (port_q,kbd_q)) Needs to be keyboard_thread = thread.start_new_thread(kbd_driver, (port_q,kbd_q)) Commas are important! -Dan Absolutely! - well spotted! As the first correct respondent, you win the