Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline Georg

  • Jr. Member
  • **
  • Join Date: Feb 2002
  • Posts: 90
    • Show all replies
Re: passing arguments to a CreateNewProc process....etc.
« on: August 03, 2005, 11:47:12 AM »
Quote
This works, but you must be careful to Forbid() before CreateNewProc() and only Permit() after you've poked the tc_UserData, or you will get rather hard to track race condition.


That does not work because CreateNewProc() will in 99% of cases call code (like DOS functions) which may break Forbid state.

But if using signals for handshake that Forbid/Permit is not necessary anyway as he will do something like

Code: [Select]

maintask:
proc = CreateNewProc()
proc->pr_Task.tc_UserData = something;
Signal(proc->pr_Task, somesignal);

subtask:
Wait(somesignal);
look at proc->pr_Task.tc_UserData


With somesignal likely being something like SIGBREAKF_CTRL_F.