[Gambas-user] [Gambas Bug Tracker] Bug #1224: Add IPC shared memory between Main process and these forks (TASK)

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Sat Feb 17 16:09:11 CET 2018


http://gambaswiki.org/bugtracker/edit?object=BUG.1224&from=L21haW4-

Comment #5 by Benoît MINISINI:

"Bilateral communication between the main process and tasks" => pipe.

Using shared memory won't avoid any data copy (using pipe, the main process writes the upcoming data to a pipe, and using shared memory, it writes it to the share memory buffer), but it will require some synchronization mechanism.

But the pipe size can be small (4K), so to avoid blocking, you have to implement a buffer on the task side, that grows as soon as the task handles the data slower than the buffer fills.

As for returning the processed data to the main process, I suggest using one another pipe, the same one for all tasks. That way, the main process sees the processed data linearly. But you can return the processed data using the RETURN instruction of the main task too.

Benoît MINISINI changed the state of the bug to: Opened.




More information about the User mailing list