[Pythonmac-SIG] bundled & shared library with python

Python Development dev_python at impactdev.com
Mon Jul 21 14:45:32 EDT 2003


On Monday, July 21, 2003, at 12:51  PM, Bob Ippolito wrote:

> On Monday, Jul 21, 2003, at 15:16 America/New_York, Python Development 
> wrote:
>
>> Hi,
>>
>> Has anyone taken an app (bundle, .nib, Localized.rsrc, ...) and 
>> invoke it from another app, such that it runs not as a different 
>> process from the calling program, but on a second thread in some sort 
>> of shared library in a two threaded app?
>>
>> What I am trying to do is call a small program that handles a system 
>> status bar (NSStatusBar/NSStatusItem -- like the sound status menu) 
>> from within a program which is running two threads.  One thread is 
>> for python & modules, while the other thread is for this system 
>> status bar.  Obviously, I can get a python (& modules) and a system 
>> status bar app to run as two different processes and communicate 
>> between each other.  In combining these two programs on two threads 
>> in one program, I hope to reduce possible problems.
>
> Only one thread per process can have a UI runloop.  You either need to 
> refactor your software so that it shares the runloop between both 
> tasks (best option), or make two separate processes communicate with 
> each other.
>
> Threads typically cause more (or at least, less obvious and harder to 
> find/fix) problems than separate processes, anyways.
>
> -bob
>
Only one of the threads has the UI and the other handles the comm, 
which is written in Python and uses C modules (per the PC spec).

I also agree with you regarding the thread input.  I have been creating 
a list of reasons why the two process model is better verses the single 
process for my boss and lead engineer (who is a PC only person).  While 
I have believed that the two process approach was best and have shown 
this to work, the lead disagrees with me.  So I am using  statements 
like yours, apple technotes and archive emails from the cocoa list to 
support my claims.

Thank you for the input.

Randy


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2022 bytes
Desc: not available
Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20030721/d8cfb3ab/attachment.bin


More information about the Pythonmac-SIG mailing list