newLISP Fan Club

Forum => Anything else we might add? => Topic started by: Jeff on March 19, 2008, 04:24:20 PM

Title: share and windows vs unix
Post by: Jeff on March 19, 2008, 04:24:20 PM
In the newlisp docs for share, it says that share can be used between parent/child processes.  I thought that meant just forks.  But share works in windows, and fork is not available in windows.  However, using the int (memory address) returned by share between processes created using (process) in windows does not work.  Am I missing something?
Title:
Post by: Lutz on March 19, 2008, 05:07:51 PM
On Win32 'share' does not return a memory address but a Win32 handle (HWND), which  is not a memory address (see newlisp_manual.html for 'share').



Because of this 'share' on Win32 works only together with 'share' in the other process. Only on Unix 'share' returns a real and usable memory address.



Peter (pjot) wrote a winfork: http://www.turtle.dds.nl/newlisp/winfork.lsp

which can be used to run programs using 'share' and 'semaphore' and also runs newlisp-x.x.x/examples/prodcons.lsp . The winfork program was made for newLISP 8.8, when source did not have an extra context parameter, but I think it still should work.