Welcome, Guest. Please login or register.

Author Topic: passing arguments to a CreateNewProc process....etc.  (Read 4927 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
passing arguments to a CreateNewProc process....etc.
« on: August 02, 2005, 06:40:20 PM »
1- Hi. Is the NP_Entry tag for CreateNewProc() a BPTR ?

2- Also. Is is possible to pass arguments to a function I want to launch as a separate process without having them as global variables ?

3- Finally. I want to have a report to the result of my function's actions. I decided to have the report not done by the function itself since it could crash, or wait a long time. My doubt is: should I create separate process that launches the function as yet another process, and reports and finishes the report with an error (timeout or something) if a certain user set amount of time has passed ? Or should I let the main program do that, checking for the returned timerequestion with SetSignal() ? I take it that if the setSignal check is nothing compared to the main() loop in terms of code size it shouldn't hurt perfomance much ? What about the overload of creating a new process everytime I want a new action to be performed (wich sometimes can happend just a few times, other times plenty...)..

That all. 8-)
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: passing arguments to a CreateNewProc process....etc.
« Reply #1 on: August 03, 2005, 05:57:18 PM »
@All
Great, it's easy then :-) to pass messages without having to look for public ports etc...

@Noster
I want the main loop to launch the process and continue with it's own things, so I can't just Wait on the main loop. I could use SetSignal to check signals but that would be busy checking. But then again, the main loop is very big so this probably doesn't hurt.

:pint:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: passing arguments to a CreateNewProc process....etc.
« Reply #2 on: August 06, 2005, 10:54:32 AM »
I was about to try it out this weekend but can't find NP_UserData tag Dietmar mentioned anywhere. I was supposing it's a tag for CreateNewProc() ? Is it an AOS3.9 only thing?

I was also about to use the process own port but the RKM's advise against using it, saying it's for exclusively use by DOS. I guess if I use it only in the beginning before using any dos function I'll be alright?

Anyway, I'd prefer that NP_UserData tag, it's more practical and I only need to send one message to the created process in the beginning, so no need for public port (Prefer not to use processes own port) allocation/deallocation and searching and waiting and geting messages and allocating deallocating them...
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show all replies
Re: passing arguments to a CreateNewProc process....etc.
« Reply #3 on: August 06, 2005, 12:19:14 PM »
Ahhh....Shame on 3.x for not having it... I'll use (struct Process *)->pr_MsgPort then...

[EDIT]

Actually I fell more tempted to poke tc_UserData.. :-)
\\"We made Amiga, they {bleep}ed it up\\"