[Gambas-user] Problem to use TASK fork processes

Olivier Cruilles linuxos at ...1896...
Mon Apr 1 19:01:56 CEST 2013


Hi Benoit,

I have just question about how to use the TASK (fork process) and particularly how to return value from the TASK to the parent.

I used all possibilities but nothing solve my problem, sometimes the parent of the Task(es) loses retourned value from the TASK.

I send result from to the parent like that, it is good or not.

-----------------------------

1st methode:

At the end of the Main() procedure of the TASK

  PRINT "RESULT" & Chr(140) & $Numero & Chr(140) & Resultat

Into the parent:

Procedure ProcStat_Read(Data as string)

	Print "(" & Str(LAST) & ")  Data: " & Data

End

-----------------------------

2nd methode:

At the end of the Main() procedure of the TASK

  WRITE #1, "RESULT" & Chr(140) & $Numero & Chr(140) & Resultat

Into the parent:

Procedure ProcStat_Read(Data as string)

	Print "(" & Str(LAST) & ")  Data: " & Data

End

-----------------------------

The gold of this program is to start many TASKs simultaneously to gain time but in fact it works better with 10 TASKs 
simultaneously and not very well with 1 TASK
So how can be sure that the TASK sent me the result all of the time please ?

Does I don't use the TASK object correctly ?

Thank's in advance.

Cordialement,

Olivier Cruilles
Mail: linuxos at ...1896...




More information about the User mailing list