On 30-jul-04, at 6:17, Justin McPherson wrote:
> Hey All,
> I am a little new to both Python and PyObjC. So please be gentle if I
> am missing something obvious :)
> I have a project, most of which is written in Objective-C. In an
> effort to cut down on the amount of code I have to write and to take
> advantage of Python's large library, I have implemented one of my
> model's objects in Python. This was easily done, by following
> examples, including the glue code etc..
> But now I have run into some troubles with threading. In an effort to
> understand threading in python, I have cut and pasted the
> 'WorkerThread' class (found in Examples/WebServicesTool), this class
> has functionality similar to my needs (later when I understand what is
> happening I will make a thread pool class). However, the thread
> function is only rarely scheduled to execute.
> It seems to be a problem with Queue. The actual thread function runs
> OK, and waits on the queue. But when an item is placed on the Queue,
> via scheduleWork(), only rarely does queue.get() return in the thread,
> allowing it to run.
> Is there something I should be doing before I use threads in PyObjC?
> Some obj-c runtime function I should be calling? Some python function?
is the main run loop started in Objective-C? If it is, you have to
update your program, see my latest message in the 'How do you write
category code?' (posted 1 minute ago). I'll let you know when I've
determined what changes should be made.
X|support bv http://www.xsupport.nl/
T: +31 610271479 F: +31 204416173