Usage (semaphore)

Started by alex, August 25, 2006, 09:05:04 PM

Previous topic - Next topic

alex

How can I use (semaphore) in Win?

Can anibody give example?

pjot

#1
Hi Alex,



Take a look here:



http://www.turtle.dds.nl/newlisp/prodcons.lsp">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">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

newdep

#2
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.
-- (define? (Cornflakes))

alex

#3
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?

alex

#4
I use newLISP v.8.9.0 on Win32 MinGW now

pjot

#5
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">http://www.turtle.dds.nl/newlisp/prodcons.lsp





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



Peter