Re: Troublesome app when scaling it up, how to proceed?
Re: Troublesome app when scaling it up, how to proceed?
- Subject: Re: Troublesome app when scaling it up, how to proceed?
- From: "Gerben Wierda" <email@hidden>
- Date: Thu, 25 Oct 2007 08:39:14 +0200 (CEST)
- Importance: Normal
>
> Are your tasks all running the same program, perhaps with different
> arguments?
See other reply.
>
> If so, you might consider using distributed objects to perform your
> remote calculations in a single process, replacing your list of
> NSTasks with a list of NSInvocations representing messages to your
> 'slave' process. This would allow you to run the slave process in the
> debugger...
I am already using DO for various reasons.
For one, my subprocess sometimes have to run in admin mode and I am using
AuthExecuteWithPrivileges() for that. That function is really broken,
because for processes started like that you cannot get the PID, you
cannote get stderr seperately from stdout (it uses a bidirectional
buffered pipe), you cannot pass an environment. So subprocesses like these
go via a different route. The main program creates named pipes for stdin,
stdout and stderr, passing the environment and pid, then starts a generic
subprocess. This subprocess attaches stdout, stdin and stderr to the right
named pipes, communicates the pid back, then execs the actual subprocess
that needs to be run. Reading output from the stderr and stdout named
pipes is done in separate threads of the main program. These programs
communicate to the main thread using DO. Since the PID has been
communicated back, I can kill these subprocesses from within the main
program (which otherwise would have been troublesome as one does not know
the pid).
Another use of DO is that there is one special subsubprocess that has to
communicate back to the main program as it steers several UI functions.
This also is done by using DO. So, I am already using DO quite a bit.
G
>
> dave
>
>
> On 23-Oct-07, at 1:06 PM, Gerben Wierda wrote:
>
>> I have an app that uses a lot of subprocesses, either via NSTask or
>> via AuthExecuteWithPrivileges. Previously, this data-driven ap would
>> have maybe a hundred subtasks in a list that were executed when it
>> was their turn, though some parallelism is possible.
>>
>> Now, my app just ends doing the subprocesses. No subprocesses are in
>> the ps list. Apparently, one process has died, but this has not
>> reached the main app. Given the complex nature of my stuff
>> (AuthExecuteWithPrivileges talk back through named pipes so I can
>> get stdout and stderr back separately in a thread in my app)
>>
>> I am sorry this is all a bit short, but there is no way I can make a
>> clear and short description of my problem. I suspect I may run out
>> of some system resource, but I have no idea which one and I suspect
>> some stuff that normally always works in the frameworks just stops
>> working)
>>
>> Anyway, I was wondering what the best tools are to track this kind
>> of a problem down. I have been looking at a few, but haven't seen an
>> obvious one to help me find out what is happening.
>>
>
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden