/* c program: -------------------------------- 1. draws Mandelbrot set for Fc(z)=z*z +c using Mandelbrot algorithm ( boolean escape time ) ------------------------------- 2. technique of creating ppm file is based on the code of Claudio Rocchini http://en.wikipedia.org/wiki/Image:Color_complex_plot.jpg create 24 bit color graphic file , portable pixmap file = PPM see http://en.wikipedia.org/wiki/Portable_pixmap to see the file use external application ( graphic viewer) */ /* ORIGINAL SOURCE CODE COURTESY OF ROSETTA CODE: http://rosettacode.org/wiki/Mandelbrot_set#PPM_non_interactive */ #include #include #include #include #include #include struct client_attributes { int self; int pipe_client_to_server[2]; int pipe_server_to_client[2]; pthread_t tid; }; struct message { int first_y; int last_y; }; struct client_attributes client_attributes[5]; struct pollfd poll_fds[5]; int create_client(int i); int send_request_client(int i, int first_y, int last_y); int shutdown_client(int i); void *client(void *id); int do_block(int,int); //int do_block(int first_y,int last_y); FILE * fp; const int iXmax = 3600; const int iYmax = 3600; const int MaxColorComponentValue=255; int bitmap[3600][3600]; int main() { int clients = 5; // create server threads int i; for(i=0; i