Re: [Icewing-devel] iceWing 0.11 release planing
Brought to you by:
floemker
From: Ingo L. <ilu...@te...> - 2012-09-10 09:23:43
|
Hiya, Am 09/09/2012 11:40 PM, schrieb Frank Lömker: > Regarding the implementation after thinking a bit more about it: > What about using only the char* and no enum. Two variables which > encode the same information is always a bit ugly and cumbersome. The > speed advantage of the enum, no strcmp needed, can be retained with > something like: > > #define IW_TYPE_IMAGE "IW01 iwImage" > #define IW_TYPE_GRABIMAGE "IW02 grabImageData" > #define IW_TYPE_STRING "IW03 char*" Okay, nice one. Lets do it like that. > typedef struct plugData { > ... > char type[20]; /* Not sure if char* or char[] is better: */ > } plugData; /* No malloc, no dereference <> arbitrary length */ > > char *t = ...; > if (*(int*)t == *(int*)IW_TYPE_IMAGE) > printf ("%s\n", IW_TYPE_IMAGE); > else if (*(int*)t == *(int*)IW_TYPE_GRABIMAGE) > printf ("%s\n", IW_TYPE_GRABIMAGE); > else > printf ("Unknown %s\n", t); A couple of macros would probably be useful here, to reduce the clutter with all those casts, but thats for later. > Checked it the first time since a while. Exiting the receiver side was > buggy (bit rotting...). And the default "max number of distributed items" > was IMHO too low, which resulted in too fast locks with already simple > examples. The current head version should work better. At least the > following examples work for me: > > 1: Distribute images to two other instances, which then process the > images with the sysiphus plugin: > > icewing -sp *png -l shmdata -a shmData1 "-p iw2 -g image" > icewing -l shmdata -a shmData1 "-p iw2 -o image" -l sysiphus > icewing -l shmdata -a shmData1 "-p iw2 -o image" -l sysiphus > > 2: Distribute images to two other instances, process them there with > sysiphus, and send one result back to the first instance where it is > further processed with sysiphus: > > icewing -sp *png -l shmdata -a shmData1 "-n 3 -p iw2 -g image" -l shmdata -a shmData2 "-p iw3 -o image2 -b" -l sysiphus -a Sysiphus1 "-i image2" > icewing -l shmdata -a shmData1 "-p iw2 -o image" -l sysiphus > icewing -l shmdata -a shmData1 "-p iw2 -o image" -l sysiphus -l shmdata -a shmData2 "-n 3 -p iw3 -g sysiphus" Nice! I'll pass that on :-) cheers -- Dr.-Ing. Ingo Lütkebohle fon: +49-521-106-12206 http://aiweb.techfak.uni-bielefeld.de/user/ingo-lutkebohle |