From: Michael R. <re...@eu...> - 2004-07-15 06:29:19
|
Hi Javi, > First I want to do is to turn them to run asynchronous, but I really > have no idea about how to do it. Async would be great. In fact, it's necessary here... > If I do a fork inside the pluging... YOu don't use fork() directly, but some helper functions provided by thread.[ch] Here you'll find functions to pass values between the processes, too. > how can I do to read from de parent process values that are written > by the child process, but without waiting for the child to end? Is > there a way to child writes a value ("global variable"?) and the > parent reads it's from a "shared memory"? you have to create a mutex for every value you want to pass, mutex_lock() it before reading and writing, and mutex_unlock() it afterwards. The value itself must be a shared memory segment created with shm_create() The child process itself is created with thread_create(). Take a look at plugin_exec.c, it uses exactly this technique. If you have any questions, feel free to ask. bye, Michael -- Michael Reinelt Tel: +43 676 3079941 Geisslergasse 4 Fax: +43 316 692343 A-8045 Graz, Austria e-mail: re...@eu... |