On Sat, May 27, 2017, 7:46 AM <streckertda...@gmail.com> wrote:

> The brokerage firm's servers are in NYC. In order to get server
> co-location I’m considering renting our a virtual server in NYC from a
> company called Linode. Their servers start at $5 a month at this price
> point you get one CPU for your virtual server.
>
> I did not know multiple threads can be beneficial with a single core.
> However, I know next to nothing about multi threaded programming! I figured
> one thread would be good for the sake of simplicity. Are you saying that
> using multiple threads on a single core could result in a performance
> boost? Even for a very simple program?
>

As an example, you said you want to talk to 2 different apis. Even on a
single cpu if you were to take advantage of running those tasks in their
own goroutines, when one task is blocked on io the other task can get
scheduled to run. Technically you can get the similar behavior in C with
threads getting a time slice on the cpu. But as you mentioned you don't
know multithreaded programming, in Go you would probably find it very
simple to organise your logic into concurrent goroutines. You just write
your code in a way that allows the Go scheduler to do its best for whatever
available amount of cpu cores are available.

-- 
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to