Page 1 of 1
Usage (semaphore)
Posted: Sat Aug 26, 2006 4:05 am
by alex
How can I use (semaphore) in Win?
Can anibody give example?
Posted: Sat Aug 26, 2006 7:38 am
by pjot
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
Posted: Sat Aug 26, 2006 8:34 am
by newdep
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.
Posted: Mon Aug 28, 2006 5:07 pm
by alex
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?
Posted: Mon Aug 28, 2006 5:13 pm
by alex
I use newLISP v.8.9.0 on Win32 MinGW now
Posted: Mon Aug 28, 2006 5:26 pm
by pjot
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