How to force OS X to use both Processors?

Posted:
in macOS edited January 2014
Hi all,



I wonder if anybody would happen to know how to force OS X to use both processors. Is there a tweak or anything that is used to do that? I am using Elgato's Hybrid TV tuner and whenever I try to watch the BBC HD trial TV, it gets really slow and the picture flickers and dissapears and then it re-appears again then it's gone . I am using an iMac 20" - 2GB Ram.

Thanks!
«1

Comments

  • Reply 1 of 29
    pbpb Posts: 4,255member
    Quote:
    Originally Posted by soulhunter View Post


    Hi all,



    I wonder if anybody would happen to know how to force OS X to use both processors. Is there a tweak or anything that is used to do that? I am using Elgato's Hybrid TV tuner and whenever I try to watch the BBC HD trial TV, it gets really slow and the picture flickers and dissapears and then it re-appears again then it's gone . I am using an iMac 20" - 2GB Ram.

    Thanks!



    Although I don't know the details about Elgato's products, Mac OS X is multi-processor aware for years now. So perhaps your problem is elsewhere.
  • Reply 2 of 29
    Quote:
    Originally Posted by PB View Post


    Although I don't know the details about Elgato's products, Mac OS X is multi-processor aware for years now. So perhaps your problem is elsewhere.



    Thanks, PB...



    But another question is: Can it be done?
  • Reply 3 of 29
    fishafisha Posts: 126member
    It all depends on the program and whether its been written to make use of threading. If a program is written to make use of multiple processing threads, then the OS will take those threads and handle them as best it can. If that means splitting it across the cores, then thats what it'll do.



    If the program isn't written in that manner, then the OS cant split up the work between 2 CPU's. You generally cant take a single thread and split it for 2 processors. You can take 2 threads and assign each to a different core though.





    The decision to do that is down to the OS and the processor . . . splitting the work across 2 cores is not by default twice as quick. There is a lot of additional work that has to be done by the CPU to manage the inputs / outputs of the cores so that they dont clash. For example, say you take 4 tasks and have 2 cores.



    You would assume that you could simply go:



    Core 1: do task 1 and 2

    Core 2: do task 3 and 4.





    but what if task 3 depended on the output of 2? ( which is reasonable cause its the 3rd task ) .then Core 2 has to wait until Core 1 has finished.



    the net result is that its not really any faster than if Core 1 had done all the work of task 1 then 2, then 3 then 4.



    Its way more involved than that, but its not just a cause of double the cores, double the speed.







    On to the tuner issue, its sounds like your over-running the buffer somewhere . . . are you sure the USB is handling the data rate well enough?
  • Reply 4 of 29
    Quote:
    Originally Posted by fisha View Post


    It all depends on the program and whether its been written to make use of threading. If a program is written to make use of multiple processing threads, then the OS will take those threads and handle them as best it can. If that means splitting it across the cores, then thats what it'll do.



    If the program isn't written in that manner, then the OS cant split up the work between 2 CPU's. You generally cant take a single thread and split it for 2 processors. You can take 2 threads and assign each to a different core though.





    The decision to do that is down to the OS and the processor . . . splitting the work across 2 cores is not by default twice as quick. There is a lot of additional work that has to be done by the CPU to manage the inputs / outputs of the cores so that they dont clash. For example, say you take 4 tasks and have 2 cores.



    You would assume that you could simply go:



    Core 1: do task 1 and 2

    Core 2: do task 3 and 4.





    but what if task 3 depended on the output of 2? ( which is reasonable cause its the 3rd task ) .then Core 2 has to wait until Core 1 has finished.



    the net result is that its not really any faster than if Core 1 had done all the work of task 1 then 2, then 3 then 4.



    Its way more involved than that, but its not just a cause of double the cores, double the speed.







    On to the tuner issue, its sounds like your over-running the buffer somewhere . . . are you sure the USB is handling the data rate well enough?



    WOW... hehehe feels like I just left Uni IT classes now... hehehehe

    Thanks a lot for your post, fisha. That was very helpful to help me understand what's going on...

    That was a good point to mention the USB... it is directly connected to the iMac... I don't have a problem with any other channel... thing is... just because HDTV is so full of data... it is quite sluggish... but I know it shouldn't be, cos I have more than enough to watch HDTV as per the system specification on their website.

    Oh well... go figure...

    I will have another look for the buffering on my USB port. I might try and change the port and see the results...

    Cheers!!!
  • Reply 5 of 29
    mr. memr. me Posts: 3,221member
    Quote:
    Originally Posted by fisha View Post


    ...



    If the program isn't written in that manner, then the OS cant split up the work between 2 CPU's. You generally cant take a single thread and split it for 2 processors. ...



    This is a bit misleading. You can't split a single thread into multiple threads. At any given time, however, MacOS X is running many tasks, not just your primary application. These can be distributed among the available cores.
  • Reply 6 of 29
    hirohiro Posts: 2,663member
    Quote:
    Originally Posted by soulhunter View Post


    Thanks, PB...



    But another question is: Can it be done?



    Not by a user.



    As mentioned earlier, the use of multiple processors is dependent on how the application itself is coded at compile time, nothing else. The OS scheduler ALWAYS uses every available processor.



    It is possible to disable processors, as root or using CHUD tools, but that is the opposite of what you ask. In that case the OS is still using all the processors available to it, only some have just been made logically unavailable.
  • Reply 7 of 29
    Quote:
    Originally Posted by soulhunter View Post


    Hi all,



    I wonder if anybody would happen to know how to force OS X to use both processors. Is there a tweak or anything that is used to do that? I am using Elgato's Hybrid TV tuner and whenever I try to watch the BBC HD trial TV, it gets really slow and the picture flickers and dissapears and then it re-appears again then it's gone . I am using an iMac 20" - 2GB Ram.

    Thanks!



    Yeah, kick the computer...show it who's boss, and let her know who's in charge HAH
  • Reply 8 of 29
    Thanks for all your replies... I guess in the end I will end up following Digital Disasta's advice...

    Oh well... Thank you too Hiro.. now I know I should stop looking for such a thing... I haven't had time to look at my USB ports (the buffering matter)... I will check if the speeds are okay...



    Oh, btw... how do I check that?
  • Reply 9 of 29
    feartecfeartec Posts: 119member
    I noticed Quake 4 has a dual processor support option which pretty much means it is program specific.
  • Reply 10 of 29
    fishafisha Posts: 126member
    Quote:

    This is a bit misleading. You can't split a single thread into multiple threads. At any given time, however, MacOS X is running many tasks, not just your primary application. These can be distributed among the available cores.



    Thats a fair point, but i was deliberately trying to keep it to the single program instance in this case.





    Quote:

    I noticed Quake 4 has a dual processor support option which pretty much means it is program specific.



    Not really sure what you mean by that.



    In terms of splitting up the processes, there are 2 parts to it. The software side and the hardware side. Software can generate many processes and the hardware can handle / split up those processes.



    Its not right to assume that a single program by default will only ever be a single process. A single program can generate multiple threads/processes ( or parallel running tasks ).



    As already said, multiple programs running will generate multiple processes / threads too.





    How the hardware deals with them its a bit of a black art. You get single core-processors which can run multiple tasks in parallel ( multithreading and Hyperthreading CPU's ). Maybe think of it as a highway where there are multiple lanes for the traffic which all run at the same time, but there is only one set of on/off ramps for the traffic ( or data ) to get in and out of the CPU.



    The dual cores take this a step further. Its more like 2 highways side by side.... So again, you have multiple lanes of traffic and data being processed, but each highway has its own on and off ramps . . . they are a bit more seperate.



    The black art comes from the workings of how data uses those on and off ramps. ( the large on-chip caches of processors, the front side busses of CPU's etc etc ) At best, the CPU applies some generic rules for handling the data flows.



    In some cases, this will mean that data gets processed quickly and in other cases, becuase of the task needing done, the data doesn't quite get processed effectively. Overall though, the dual cores and generic rules result in a higher over-all processing power.





    Going back to the Quake 4 thing .... its perfectly possible that in a generic setting, Quake 4 will generate multiple processes which it will leave up to the OS to handle and split between the cores.



    If, however, Quake 4 knew for a fact that it was running on a dual core machine ( as per the user telling it in the options menu ), then the software developers could have written / tweaked the code such that the data that needs to get crunched by the dual core CPU is presented to it in a format which would allow it to pass through to the cores in the most effective manner.



    Think of that more like a toll barrier on the on-ramp. If your instructions are not in the right format, its like stopping at the barrier, handing over some money the toll having to do a bit of re-orgnaising to give you some change back, and then allowing you to get onto the highway to get your data processed.



    If you knew the toll value in advance ( like it was a dual core ), then you could come to the barrier with the right change ( instruction format ) , hand it over, and carry on through more effectively.





    Thats a hugely simplistic version of it . . . but gives you a jist of it.
  • Reply 11 of 29
    hirohiro Posts: 2,663member
    Quote:
    Originally Posted by fisha View Post


    Not really sure what you mean by that.



    <snip>



    Thats a hugely simplistic version of it . . . but gives you a jist of it.



    Don't try so hard! You made it too complicated!



    Q4 is multi-threaded. That's it, no multiple processes, just multi-processor aware.



    And none of it is really back art. There are many programmers/managers that want you to think that, but a little knowledge can eliminate the fear of threading and synchronization.
  • Reply 12 of 29
    fishafisha Posts: 126member
    Quote:
    Originally Posted by Hiro View Post


    Don't try so hard! You made it too complicated!



    Q4 is multi-threaded. That's it, no multiple processes, just multi-processor aware.



    And none of it is really back art. There are many programmers/managers that want you to think that, but a little knowledge can eliminate the fear of threading and synchronization.



    i was thinking more of the cpu hardware side of things. essentially the design of the cpu must be a massive compromise where the overall result for the most part works better.
  • Reply 13 of 29
    webmailwebmail Posts: 639member
    Elgato's products suck. Sorry it had to be said. Everyone buys these TV recorders because they want to accessorize their Macs, and adding TV sounds cool. Except the fact that it won't work with your cable (without cable card) your doomed to boring channels, or manually changing the cable box channel to view it on your mac.



    Elgato however has a bigger mistake, they offer video input on all their devices, in different forms, including RCA, S-VIDEO and so forth, but you can only view the INPUT using eyetv. That means if you ever want to plug-in a video cam, security cam, miniture camera, you won't be able to use it with quicktime, or any other mac software, the only way is using eyetv. This alone stinks.



    Not to mention the software is poorly threaded, and it's estimates on the processor you will need is a shame. I use the eyetv (yeah the most expensive one) on my 8 core mac pro, and it still studders often.



    The second thing, is Apple's fault. There is a big, big bug with virtual memory swapping every 30 seconds in Tiger. It's 90% of the reason you get the beach-ball. This is fixed in leopard, and shows a HUGE improvement with "sluggish" applications.
  • Reply 14 of 29
    feartecfeartec Posts: 119member
    Wow, guys. Wow. Honto zen zen wakani. Sugoy.
  • Reply 15 of 29
    hirohiro Posts: 2,663member
    Quote:
    Originally Posted by fisha View Post


    i was thinking more of the cpu hardware side of things. essentially the design of the cpu must be a massive compromise where the overall result for the most part works better.



    Not in the least. No compromises necessary, not even for SMT/Hyper-threading. And a CPU is totally oblivious to the concept of multiple processes, other than it knows how to do a context switch when prompted.
  • Reply 16 of 29
    dfilerdfiler Posts: 3,420member
    I use Elgato's Hybrid EyeTV on a daily basis and it performs nearly flawlessly. Hopefully, it can do the same for you...



    The sluggishness you're experiencing is mostly due to the heavy-weight nature of decoding HD in software. Other more expensive products do the decoding in hardware, resulting in less CPU usage and less noticeable impact on other processes.



    Another thing to look at is how full your hard drive is. If you're buffering uncompressed HD to and from the drive constantly, free drive space can have an absolutely huge impact. You'll need at least tens of gigs free if not a hundred gigs for optimal performance. Even though that space could be considered "unused" it is still needed to keep drive access speedy.
  • Reply 18 of 29
    hirohiro Posts: 2,663member
    snake oil.



    Yes, it can manipulate the nice and re-nice values. But that does nothing to the timer. And the amount of processing the vast majority of background apps use is negligible to start with. Not to mention that no matter how much you increment the nice values, the feedback function in the scheduler will still decrement the app every quanta no matter what.
  • Reply 19 of 29
    feartecfeartec Posts: 119member
    Agreed. Sounds like useless programs that:



    "Speed up your machine by 300%, bake cakes and also find you the love of you life!!!! BUY BUY BUY!!!!"



    even invade OSX. This program is useless, I installed it and ran some real tests to tell the difference and I have to say you might as well tell it to go faster verbally. It may actually respond better.
  • Reply 20 of 29
    hirohiro Posts: 2,663member
    Quote:
    Originally Posted by Feartec View Post


    I have to say you might as well tell it to go faster verbally. It may actually respond better.



Sign In or Register to comment.