Usage (semaphore)

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

Usage (semaphore)

Post by alex »

How can I use (semaphore) in Win?
Can anibody give example?

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post 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

newdep
Posts: 2038
Joined: Mon Feb 23, 2004 7:40 pm
Location: Netherlands

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

alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

Post 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?

alex
Posts: 100
Joined: Thu Mar 10, 2005 2:27 pm
Location: Russia

Post by alex »

I use newLISP v.8.9.0 on Win32 MinGW now

pjot
Posts: 733
Joined: Thu Feb 26, 2004 10:19 pm
Location: The Hague, The Netherlands
Contact:

Post 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

Locked