Book Image

D Cookbook

By : Adam Ruppe
Book Image

D Cookbook

By: Adam Ruppe

Overview of this book

Table of Contents (21 chapters)
D Cookbook
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating new processes


Processes are the main isolation unit in a multitasking operating system. Separate program instances run in separate processes, giving each one an isolated memory space and execution context which can never accidentally step on the toes of another.

Processes can also be a useful concept in the context of a single logical program. Creating a child process can allow you to use a separate program to help you complete your task or can isolate a subtask inside your program from the rest of it, giving you resiliency against crashes as well as concurrency and parallelization across several processors, even across several different physical computers in some cases.

How to do it…

Here, we'll briefly explore using processes for two tasks: creating crash-resistant plugins, which will work well across platforms, and forking execution to handle independent tasks, which uses Posix functions.

To create a crash-resistant plugin, we need to execute the following steps:

  1. Write the plugin...