home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / memlink.zip / README.TXT < prev   
Text File  |  1995-08-09  |  3KB  |  59 lines

  1.                 MEMLINK.DLL
  2.  
  3. MEMLINK.DLL is an OS/2 Dll that provides an alternative means for IPC 
  4. (interprocess communication) between two concurrently running OS/2 threads. The
  5. threads can be in the same process, or in two different processes.  It was 
  6. written to replace the named pipe mechanism of passing user-defined data
  7. structures between 4 concurrently running processes.  The application was
  8. acquired from an outside source and the named pipe code was poorly written,
  9. with initialization, termination, and the stuff in-between coded poorly.  This
  10. caused the application to lock-up in various situations and the pipes to "break"
  11. on occasion. 
  12.  
  13. A simpler, cleaner, method to pass this data was desired, hence
  14. MEMLINK.  MEMLINK uses shared memory in a .DLL to pass the data between
  15. the tasks.  The data is passed very much like in named pipes, where 
  16. synchronization of the reading and writing of data is crucial.  When a thread 
  17. attempts a write of data to another thread, the thread is blocked on the 
  18. write until the other thread has read a previously written data item.  When a 
  19. thread wants to read data from the other thread it is blocked until data is 
  20. available to be read.  The synchronization is performed using semaphores.  
  21. Initialization and use of the semphores is done automatically by the .DLL and 
  22. the programmer does not have to deal with them.  There are only 3 simple 
  23. routines in MEMLINK called from outside the .DLL.
  24.  
  25. The result of using MEMLINK was worth the time of writing it.  The mechanism
  26. proved to be much simpler and cleaner.  After a month of heavy use the 
  27. mechanism has yet to hickup.  It allowed us to get rid of the named pipe code 
  28. from the application, making for a more reliable and easier to understand 
  29. mechanism of IPC between the 4 processes.
  30.  
  31. The implementation of MEMLINK is pretty straight forward.  Look at the header
  32. of the source file PIPES.C for more details and how to use it in your own
  33. application.  The source code for the quick-and-dirty demo program may also be 
  34. helpful.  The demo program MDEMO simply starts up 2 threads that pass data
  35. between them using MEMLINK.  This is a very simple implementation with only a
  36. single process and multiple threads.  MEMLINK can be used between threads in
  37. the same process or threads in different processes.  
  38.  
  39. INCLUDED FILES:
  40.  
  41. README.TXT         This file.
  42. PIPES.C            The only "C" file used to make MEMLINK.DLL
  43. PIPES.H            The header file needed to make and use MEMLINK.DLL 
  44. MEMLINK.MAK        The make file used to create MEMLINK.DLL
  45. MEMLINK.DEP        The dependency file used to create MEMLINK.DLL
  46. MEMLINK.DEF        The definition file used to export MEMLINK.DLL routines.
  47. MEMLINK.DLL        A ready-made version of MEMLINK.DLL (made for MDEMO).
  48. MEMLINK.LIB        .LIB of MEMLINK.DLL that gets linked into MDEMO. 
  49. MDEMO.*            All the files used to make up the MDEMO demo program.
  50.  
  51. All files included here is freeware.  Do whatever you want with it.  I claim
  52. no responsibilities or warranties with it's use.
  53.  
  54. If you have any questions or comments feel free to e-mail me at the following 
  55. address.  If you find it useful I'd be interested to know how it was used.
  56.  
  57. Jeff Orth
  58. 74632.2324@COMPUSERVE.COM
  59.