home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / mandlcpp.zip / readme.doc < prev    next >
Text File  |  1993-06-27  |  5KB  |  161 lines

  1. Hi C++ programmers!
  2.  
  3. This is the second version of my C++ library for OS/2.
  4. The example program will show, how to program OS/2 PM without using
  5. any global variables and with using inheritance.
  6. I get sick, if I see the lot of programs, written in C
  7. - unsing one global context.
  8. I've found a lot of bugs and changed a lot of stuff.
  9. The example program for calculating a mandelbrot fractal image
  10. has changed. Now you can zoom in rotated and you can select wether
  11. you want to use a new window or the old one.
  12. But the best think is, that you can use all machines in a network
  13. to help calculate your image - that is distributed computing or multiprocessing.
  14. I would be glad, if some one implements color palette animation.
  15. I've already done this in a old version for the antiquated DOS -
  16. is looks nice. I've used a random number generator
  17. to change every palette entry, while shifting the palette entries.
  18.  
  19. Also an interesting idea is to put the iteration stuff into a DLL.
  20. The user should be able to write his own DLL.
  21. This dll should contain some vectors,
  22. one including the addresses of iterations functions,
  23. one including names for this iterations methods.
  24. The user should be able to select such a name from a menu
  25. - this is the way to select a iteration method.
  26.  
  27. There are two executables, server.exe and client.exe.
  28. You can use client.exe without server.exe if there is only one machine.
  29. server.exe should be started on every machine available (via autoexec.bat ?)
  30. in the following way:
  31.  
  32.     server.exe \pipe\uniqueName 2> uniqueName.out
  33.  
  34. or
  35.  
  36.     server.exe \pipe\uniqueName 2> nul
  37.  
  38. if you don't want the error output saved.
  39.  
  40. "uniqueName" should be a name which is unique in the network.
  41. This names should be collected in a file in the following way:
  42.  
  43. \pipe\uniqueName1
  44. \pipe\uniqueName2
  45. \pipe\uniqueName3
  46. \pipe\uniqueName4
  47. \pipe\uniqueName5
  48. \pipe\uniqueName6
  49.  
  50. The name of this file should be passed on the commandline to client.exe.
  51. If there is such a file for client.exe, client.exe will no more calculate
  52. the image itself, but instead of this send requests to the servers.
  53.  
  54. I'VE NOT TESTED THIS IN A NETWORK - I HOPE THIS WORKS ON A NETWORK.
  55. I would be pleased to hear something about this.
  56. The server is able to services more then one client.
  57. It was a nice experience, to write such stuff without using the antiquated
  58. fork() unix system call, but instead of this using threads.
  59.  
  60. The client uses the following files:
  61.  
  62. object.cpp
  63. chain.cpp
  64. tree.cpp
  65. process.cpp
  66. pmprocess.cpp
  67. apfel.cpp
  68. apfel.rc
  69.  
  70. the server uses the following files:
  71.  
  72. object.cpp
  73. chain.cpp
  74. tree.cpp
  75. process.cpp
  76. server.cpp
  77. server.def
  78.  
  79. Yes I know that code which is used by more then once executable
  80. should be collected into a shared library or dynamic link library.
  81. You can do this. if you want.
  82.  
  83. This is the class hierarchy:
  84.  
  85. object
  86.   mtxObject
  87.     chain
  88.     chainElement
  89.   construct
  90.   string
  91.  
  92.  
  93.     chainElement/string
  94.       stringChainElement
  95.  
  96.     chain/chainElement
  97.       tree
  98.  
  99.   construct/chainElement
  100.     thread
  101.       pmThread
  102.     pmWindowThread
  103.     pmMsgThread
  104.  
  105.   construct/chain
  106.     process
  107.       pmProcess
  108.  
  109.     tree
  110.       windowTree
  111.     processWindow
  112.  
  113. Some documentation is done in the include (*.h) files and also in the .cpp files.
  114.  
  115. I've used Borlands C++, caused of the fast compilation
  116. and good debugging capabilities.
  117. The optimzation of this compiler is quit poor - compared to EMX.
  118. EMX uses all coprocessor registers, keeps local double variables in the
  119. coprocessor. Borland C++ fetches local double variables always from memory.
  120. I did not test the speed difference - but I would be pleased
  121. if there is someone how does and make the values public.
  122. Server.exe crashes if you compile it with optimization option "Fastest Code".
  123. This is caused of that the function calculate() does the following:
  124.  
  125.     - allocates space on the stack for local variables
  126.     - saves some registers on the stack
  127.     - makes alloca
  128.     - calculates the image
  129.     - restores the saved registers
  130.         (BUT THE STACK POINTS CURRENTLY TO THE MEMORY AREA RETURNED
  131.         FROM alloca!!!)
  132.  
  133. It seems that the client contains the same bug,
  134. if you compile using optimization.
  135. I think I'll use the EMX for product versions.
  136. The included version is the Borland version with optimizing option
  137. "minimal optimizing".
  138. The provided file c2mt.dll is the dll version of Borlands c library
  139. (I don't know why Borland provides a static version of this library -
  140. may be for people which own machines with to much memory.)
  141.  
  142. If someone wants to use this library, he can do it.
  143. I don't claim anything.
  144. And of course there is no guarantee for anything in this library or the example
  145. programs.
  146.  
  147.  
  148. If someone want to get some information or want to send some suggestions:
  149. This is my telefon number (only voice)
  150.     49 7345 22870
  151.     (remember the time difference - this is in germany)
  152. and EMAIL:
  153.     peter@anacad.de
  154. and CompuServe:
  155.     100114,351
  156.  
  157.  
  158. Peter Foelsche
  159.  
  160. Happy Multithreading
  161.