Atomic functions often serve purposes in mutexes and SMP. You want to be able to lock a mutex in one cycle (at least few enough cycles guaranteed to be executed before another process is scheduled). If you try to lock a mutex without using atomic functions, then two processes might try to lock a mutex at the same time and both get stuck in a deadlock. This would sorta suck.

Eirik Nygaard wrote:

Hi...

I am just wondering what the atomic_* functions in machine/atmoic.h does.
I have read the assembly code and more or less understood it, but I still
don't see the need for it. So if anyone would enlighten me that would be great.






-- William Michael Grim Student, Southern Illinois University at Edwardsville Unix Network Administrator, SIUE, Computer Science dept. Phone: (217) 341-6552 Email: [EMAIL PROTECTED]


_______________________________________________ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to