[Barrelfish-users] FW: How to write a self-replicating service

Simon Peter speter at inf.ethz.ch
Tue Sep 20 14:16:11 CEST 2011


Hi Georgios,

There are several functions. The most generic is spawn_program(), which 
is used in usr/mem_serv_dist/mem_serv.c, like this:

     for (int i = 0; i < args->cores_len; i++) {
         err = spawn_program(args->cores[i], new_argv[0], new_argv,
                             NULL, 0, NULL);
         if (err_is_fail(err)) {
             DEBUG_ERR(err, "spawning percore mem_serv on core %d", i);
             return EXIT_FAILURE;
         }
     }

I'd suggest doing something similar. You can safely inherit the 
environment by passing NULL for envp.

BSP is short for Boot Strap Processor. It's x86 terminology.

Hope this helps,
Simon

On 20.09.2011 14:08, Georgios Varisteas wrote:
> Hi again,
>
> Let me make this question a bit more specific. I would like to know what is the best alternative to spawn() in usr/spawnd/service.c that allows a process to spawn a new process on any core other than it's own? Also I would very much appreciate any info on the "char *const envp[]" argument, as what is provided (in other source files) is not really informative. Is it safe in my context to inherit the environment by passing NULL?
>
>
> Thanks in advance,
> Georgios Varisteas
>
>
> ________________________________________
> From: Georgios Varisteas [yorgos at kth.se]
> Sent: Monday, September 19, 2011 16:51
> To: barrelfish-users at lists.inf.ethz.ch
> Subject: [Barrelfish-users] How to write a self-replicating service
>
> Hi,
>
> I would like to ask for the appropriate methodology (API-wise) and structure to use for a service which, when run on a core, will automatically spawn other instances of itself on other cores (not necessarily all available)? A perfect, already implemented example is the monitor. However, by looking into its source code I couldn't get a generic methodology, so i though to ask here before basing my code on the wrong assumptions.
>
> Also, what do the initials BSP [core] stand for?
>
> Best regards,
> Georgios Varisteas
> _______________________________________________
> Barrelfish-users mailing list
> Barrelfish-users at lists.inf.ethz.ch
> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users
>
> _______________________________________________
> Barrelfish-users mailing list
> Barrelfish-users at lists.inf.ethz.ch
> https://lists.inf.ethz.ch/mailman/listinfo/barrelfish-users




More information about the Barrelfish-users mailing list