semaphores do not access like volatile

Niko Schwarz niko.schwarz at gmx.net
Mon Feb 10 10:38:16 UTC 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I'm doing this: I send my authentication to a server, and then wait on a 
semaphore. A reading process checks for response. if it has response, it 
changes an instance variable (results), and sends signal to the semaphore.

Now a funny thing happens: the semaphore releases the first thread, but the 
instance variable didn't change (fast enough). if i add an additional delay, 
everything works fine. 
what id do in java now would be declaring results volatile, but what should i 
do in squeak?

regards,

nick
- -- 
"I'd love to go out with you, but I'm staying home to work on my
cottage cheese sculpture."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE+R4Ec3P3nmXTVnC8RAoCrAJ4mKzYdN5ppX/AoZ2hwyd0QY6QCzgCeKISr
g2YPrp3tsPBkjlWalfgdwSU=
=JkBs
-----END PGP SIGNATURE-----



More information about the Squeak-dev mailing list