Just use threads.  Its easier and works the same.

Here is my init_descriptor using threads as an example.
#include <pthread.h>

pthread_t thread;

pthread_create(&thread, NULL,(void *)init_descriptor,(void *)control);
pthread_detach(thread);

Init_descriptor instead of returns has "pthread_exit()"  and you have a
threaded app.

create and exit.  It uses the SAME memory you have now.



compile with -lpthread

----- Original Message ----- 
From: "Dale Kingston" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, August 02, 2003 9:44 PM
Subject: Fork()


> Does anyone know where I could read up on how to use fork()? Would like
the
> mud to do something on the side, but it's going to take a second or two to
> process it.
>
> Basically I've made a pfile cleaner to go through and clean up the pfiles
> remove old ones what not. And I have it do a backup to when it does this.
> But it causes the mud to halt for a second while it does all this. So I've
> heard/seen a little bit on fork. But idk really how to use it. This
cleaner
> is just one function so would I just like:
>
> if (fork())
> {
>     clean_pfiles();
>    exit(0);
> }
>
> Or how would I use fork to do that. I don't need anything from the process
> information wise. I would just need it to run this one function and the
> close the process.
>
> So if anyone knows somewhere, where I could read up on it. Or maybe an
> explaininaion on how to do this would be very appreciated.
>
>
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>
>



Reply via email to