On my machine (iMac 2009?, Core 2 Duo -> 2 Cores), the script needs like 12sec.
Switching to processes (change comment from line 22 to 23), it's down to about 5sec.
Not sure about the OS overhead, but comparing the execution times, with processes BOTH my cores need to be running, right?
On Quadcore machines, this difference should show a factor of 4... maybe someone can try (you might need to change the loops in line 11 to get somewhat reasonable times)?
Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.
Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.
Works under Windows on my Quad Core.
Your ThreadVsProcess.py as is, gets spread over 2 of my cores:- 
And modifying it to run 8 threads, spreads the load out over all 4 of my cores, although not quite evenly, core 1 is doing slightly less work:- 
On my machine (iMac 2009?, Core 2 Duo -> 2 Cores), the script needs like 12sec.
Switching to processes (change comment from line 22 to 23), it's down to about 5sec.
Not sure about the OS overhead, but comparing the execution times, with processes BOTH my cores need to be running, right?
On Quadcore machines, this difference should show a factor of 4... maybe someone can try (you might need to change the loops in line 11 to get somewhat reasonable times)?
Bottomline (my interpretation): At least for python threads, threads won't run in parallel on several cores.
Note that, as it stands, the two webservers and the dns server basically NEVER run at the same time anyway.
Yes and no.
As I stated somewhere, PlexConnect is not really a processor hurting application.
The two WebServers will - most likely - not run in parallel, you are right. The SSL one is of extremely low usage anyway (ok, skip the iMovie issue...). However, depending on your setup (multiple aTVs anyone?), DNS and WebServer might want to run in parallel.
But then again our "worker" WebServer calling XMLConverter might get multiple requests at the same time as well, all of which are currently not really answered in parallel... tststs.
But you won't see every core at 100%. So, yes, python itself is switching between cores, but never running on two or more at the same time. With the processes you should technically see every core maxed out...
Run it using processes - and check processor load and runtime.
Umm.. your right.. which means threading in python is totally broken. I'm a .net programmer and threading works fine under that language. Take for example the following .net program:- 
The two WebServers will - most likely - not run in parallel, you are right. The SSL one is of extremely low usage anyway (ok, skip the iMovie issue...). However, depending on your setup (multiple aTVs anyone?), DNS and WebServer might want to run in parallel.
But then again our "worker" WebServer calling XMLConverter might get multiple requests at the same time as well, all of which are currently not really answered in parallel... tststs.
Unless you have like hundreds of AppleTVs around, the dns will get hit very very rarely. And, even if it was the case, it would be a lot more efficient to simply provide a response with a very long TTL.
Moreover, the threads will run "more or less" in parallel anyway, because most of the time is spent downloading data from plex or uploading data to the appletv.
Thanks Wahlman. I already did that and it didn't help. But today, I am a happy user again. I don't know why, but it is working again. The only thing I did is connecting my aTV with a new Ethernet cable (I was using wifi at the moment). Isn't it supposed to be working also with wifi? And the other thing I noticed, is that my icloud and itunes log-ins in aTV where kicked out. They do not appear anymore. Would be nice to know what caused the problem. I will try now to resolve the problem with my friends aTV. Will report back.
Edit: Ah and iMovie is working great with the patch! Thanks!
I just wanted to confirm that applying the AppleTV update with the standard Trailers highjack worked flawlessly for me.
Switched DNS to automatic
Updated to new software version
Re-added my PlexConnect server as DNS
Everything works as before
I have always said that 5% of failures are due to code. As for the remaining 95%, the rot cause resides between the chair and the keyboard. Thank you Azathooth for identifying the obvious mistake of my ways. I have forgoten to change the DNS back to PlexConnect.
I guess what I'm trying to say is that the ATV update released yesterday had no impact on PlexConnect performance. Except, maybe like wahlman.j highlighted, it seems faster. For an ATV 2 & ATV 3, I'm running:
1. Mavericks V10.9.5 on a late 2011 MBP with 2.2 GHz Intel Core i7 processor
2. Airport Extreme V7.7.3
3. OpenPlex V1.0
4. PlexConnect V0.3.1+
5. PMS V0.9.10.1.585-f31034e
What did I do...?
1. Reset ATV to factory settings
2. Updated ATV Software
3. Logged in to: iTunes, iCloud and activated Home Sharing
Dammit. I thought I would play a little with the themes... chose a new one in the theme tab which deleted the certs. I hijacked iMovie again, went to my aTV, deleted the old profile, loaded the new one, restarted and aaaaaaaaaaahhhhhhhhhhhhhhh: THE PROBLEM APPEARED AGAIN!! I can not understand what the problem is. But it seems it is something very simple...
Interesting. The issue seems to be that iOS now doesn't show the progress bar right at the beginning. It's not shown, it won't need to get hidden - so PlexConnect is not notified to fade out the own displays.
Will get fixed - like generate hidden at startup, or add a nice reminder to hide it 5sec later?
Every time I try following these steps, plexconnect stops working on number 5 restarting plexconnect. It says in the notification center: PlexConnect is Not Running...
For the meantime on OSX I am coding a temporary fix until this can be resolved for ios 8 via OpenPlex. I think it's a little much just for iMovie to work when there is plenty of other apps to hijack but to each their own. Also you cannot update to the latest github commit when you overwrite the git cloned files with the temporary fix since it modifys the git clone so you would need to git clone and patch every time if iMovie is a must for you on iOS 8. I recommend using the storefront button to find a alternative app in your geographic location instead but again this is up to the user to go thru all of that just for iMovie to work.
@creativeblends install teamviewer and send me a pm with your temporary id/pw and I can help you. Please restart you mac and do not start plexconnect via terminal then send me the login info.
I recommend using the storefront button to find a alternative app in your geographic location instead but again this is up to the user to go thru all of that just for iMovie to work.
It's not "just for iMovie to work": There's actually a bug in the way PlexConnect handles https connections, and the fix itself is not really such a big deal.
First off, it's not like PlexConnect is going to be used to serve a hundred of clients and the webserver, internally, will use threads to serve multiple parallel requests anyway.