This is generally considered poor practice, as it eats up processor time, and is a particular concern in multi-tasking or multi-user environments. However, spinning can be a valid strategy in certain special circumstances, most notably in the implementation of spinlocks within operating systems themselves.
Alternatives include event notification and polling (depending on the capability of the operating system).