Ok this is very random but worked 100% so far. for all you with issues with wifi on mavericks or yosemite this really worked for me.
My wife has imac i have Macbook Pro...
We moved house 12 months ago set up everything but not apple tv.... it was plugged in but didnt set network.... in june we came back from holiday and i set up network for apple tv....few days later my wifes WIFI stopped working, she put her imac into sleep and wouldnt get connection after like it seems everyone here..... nothing worked. My macbook fine as i didnt put it to sleep.
SO we never use apple tv although connected but never turned on... my wife continued to have same problems as everyone here.. mine was fine as were all the other devices.
Few weeks ago we had some bad lightning and the wifi box blew up so a new one was purchased, my wife connected to the network as did i and as did 2 ipads 3 iphones... no issues...
MY WIFES imac worked perfectly..... Like MAGIC
Yesterday i started apple tv put it on the new network no problems all devices and mac book and imac perfect...
Today i put my macbook to sleep when my wife Unbeknown to me was watching APPLE TV ( NETFLIX) i started it again after about 20 min and the issue was a nightmare... same problems as everyone on here... my wife started imac from being turned off and no issues....
SO HERES WHAT I DID.... i turned apple tv OFF turned it back on again nothing changed i still had issues...I THEN DISCONNECTED APPLE TV from the NETWORK and let it turn off.... i came to my laptop restarted it from shutting down and guess what? no issues whatsoever...
SO FOR ME the issue is with APPLE tv on same network, surely this is why it only affects some macbooks not others.... also im running Yosemite and as i say never once had an issue until today when i put macbook to sleep with apple tv on...