newLISP Fan Club

Forum => newLISP and the O.S. => Topic started by: alex on August 25, 2006, 09:05:04 PM

Title: Usage (semaphore)
Post by: alex on August 25, 2006, 09:05:04 PM
How can I use (semaphore) in Win?

Can anibody give example?
Title:
Post by: pjot on August 26, 2006, 12:38:42 AM
Hi Alex,



Take a look here:



http://www.turtle.dds.nl/newlisp/prodcons.lsp





You also need the FORK for Windows ("winfork") to run it:



http://www.turtle.dds.nl/newlisp/winfork.lsp





I am not sure how well it runs though. There have been some changes in (source), for example. On my on machines at home I do not have Windows anymore, but I can verify it next week at my work.



Peter
Title:
Post by: newdep on August 26, 2006, 01:34:29 AM
Actualy semaphore is not that different to simmulate if its not in the OS your

worknig with... The only thing you need is "1 common share", that could be also

a file a named-pipe or anything that alows you to read/write too..



Norman.
Title:
Post by: alex on August 28, 2006, 10:07:04 AM
I try use (winfork) in example for (semaphore) from manual - it is not work :-(

(prodcons) can't work because of (wait-pid) can't work in Win(see manual). :-(



Resume: I have function (semaphore) in Win, but I can't use it.

What is wrong?
Title:
Post by: alex on August 28, 2006, 10:13:40 AM
I use newLISP v.8.9.0 on Win32 MinGW now
Title:
Post by: pjot on August 28, 2006, 10:26:28 AM
Indeed, there is no (wait-pid) in Windows.



Therefore you have to use my version of 'prodcons' which I mentioned earlier:



http://www.turtle.dds.nl/newlisp/prodcons.lsp





As you can see, there is no (wait-pid) in there.



Peter