Jump to content

multi threading

Nineballo
Go to solution Solved by WereCatf,
20 minutes ago, Domi-Nate said:

could it be possible to have a software layer directing single threaded programs to spread the load across multiple cores without the program really knowing(for compatibility) then directing the then processed information back into the program as one thread?

Short answer: no. Longer answer: if it was e.g. an interpreted language or a VM-based thing, like e.g. Java, the interpreter/VM itself could be multithreaded and some specific operations could be spread to other cores/threads, but it's still not quite the same thing as you're thinking of.

could it be possible to have a software layer directing single threaded programs to spread the load across multiple cores without the program really knowing(for compatibility) then directing the then processed information back into the program as one thread?

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
Share on other sites

Link to post
Share on other sites

I think you're over thinking it... What would this be used for?

My Build, v2.1 --- CPU: i7-8700K @ 5.2GHz/1.288v || MoBo: Asus ROG STRIX Z390-E Gaming || RAM: 4x4GB G.SKILL Ripjaws 4 2666 14-14-14-33 || Cooler: Custom Loop || GPU: EVGA GTX 1080 Ti SC Black, on water || PSU: EVGA G2 850W || Case: Corsair 450D || SSD: 850 Evo 250GB, Intel 660p 2TB || Storage: WD Blue 2TB || G502 & Glorious PCGR Fully Custom 80% Keyboard || MX34VQ, PG278Q, PB278Q

Audio --- Headphones: Massdrop x Sennheiser HD 6XX || Amp: Schiit Audio Magni 3 || DAC: Schiit Audio Modi 3 || Mic: Blue Yeti

 

[Under Construction]

 

My Truck --- 2002 F-350 7.3 Powerstroke || 6-speed

My Car --- 2006 Mustang GT || 5-speed || BBK LTs, O/R X, MBRP Cat-back || BBK Lowering Springs, LCAs || 2007 GT500 wheels w/ 245s/285s

 

The Experiment --- CPU: i5-3570K @ 4.0 GHz || MoBo: Asus P8Z77-V LK || RAM: 16GB Corsair 1600 4x4 || Cooler: CM Hyper 212 Evo || GPUs: Asus GTX 750 Ti, || PSU: Corsair TX750M Gold || Case: Thermaltake Core G21 TG || SSD: 840 Pro 128GB || HDD: Seagate Barracuda 2TB

 

R.I.P. Asus X99-A motherboard, April 2016 - October 2018, may you rest in peace. 5820K, if I ever buy you a new board, it'll be a good one.

Link to comment
Share on other sites

Link to post
Share on other sites

help spread the load across the whole cpu i think this would come in handy with the crazy core count cpus (24+ cores) because the speed of the individual cores isn't great but if you could have them all working together it might be able to do something.

 

 

im just dipping my feet into programming and thought of this figured i might as well see if this would make sense or change anything.

 

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
Share on other sites

Link to post
Share on other sites

diagram of a single threaded program

 

                                 program

                                     | single thread

      layer -->    --------------------------

                         /    /   /   /    \   \  \  \  \      split between in this case 9 cores

 CORE # -->    1    2  3  4    5  6  7 8 9

 

does it kinda make scene now?

 

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
Share on other sites

Link to post
Share on other sites

im tired maybe this just is completely wrong...

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
Share on other sites

Link to post
Share on other sites

20 minutes ago, Domi-Nate said:

could it be possible to have a software layer directing single threaded programs to spread the load across multiple cores without the program really knowing(for compatibility) then directing the then processed information back into the program as one thread?

Short answer: no. Longer answer: if it was e.g. an interpreted language or a VM-based thing, like e.g. Java, the interpreter/VM itself could be multithreaded and some specific operations could be spread to other cores/threads, but it's still not quite the same thing as you're thinking of.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

aight thx for the answer

Spoiler

CPU: 5800x

GPU: 1070ti

HDD: Seagate 3TB
SSD: 1TB WD NVME

RAM: 32GB ddr4 3200

HEADPHONES: DT990 pro 250ohm limited edition black

MONITER: BenQ xl2536

CASE: s340 elite hyperbeast

KEYBOARD: nk87- zilent switches

MOUSE: G403 Hero

 

Link to comment
Share on other sites

Link to post
Share on other sites

46 minutes ago, Domi-Nate said:

could it be possible to have a software layer directing single threaded programs to spread the load across multiple cores without the program really knowing(for compatibility) then directing the then processed information back into the program as one thread?

In theory, you could as certain parts of a program are self contained chunks you could consider as miniature programs. Though this would require said software to look ahead and see what the program is doing and evaluate whether or not there's no dependencies. This would probably take longer to do than if you were to just do it.

 

Though I think certain code-morphing systems like Project Denver can do something like this.

Link to comment
Share on other sites

Link to post
Share on other sites

Given a typical program that's probably not already multi-threaded to the maximum possible degree, in theory this could be done, but there's two issues:

  • The processor or some other mechanism would have to figure out what parts of the program can be split up on the fly.  I can't even imagine how difficult (not to mention demanding) this would be.
  • At some point, you get down to indivisible workloads.  At this point there's just no way to split it further.  If you could, that would really be a holy grail of sorts since no longer would CPUs have to trade off between multi-core and single-core performance - any task could just use the whole CPU and it would be amazing.

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
Share on other sites

Link to post
Share on other sites

5 hours ago, Ryan_Vickers said:

Given a typical program that's probably not already multi-threaded to the maximum possible degree, in theory this could be done, but there's two issues:

  • The processor or some other mechanism would have to figure out what parts of the program can be split up on the fly.  I can't even imagine how difficult (not to mention demanding) this would be.
  • At some point, you get down to indivisible workloads.  At this point there's just no way to split it further.  If you could, that would really be a holy grail of sorts since no longer would CPUs have to trade off between multi-core and single-core performance - any task could just use the whole CPU and it would be amazing.

it would be difficult and would cause a crap ton of context switching where instruction does not except one to happen. I know for a fact on a VM server you can fake 1 core to show as 2 but i have never seen the inverse and anyhow that crazy split is quite a big performance hit.

Link to comment
Share on other sites

Link to post
Share on other sites

Autovectorization is a thing in compilers, though it's probably not quite as effective as what you are looking for and it can't work on existing binaries (aka you couldn't take an application and emulate your way to threading). It's like an extension to loop unrolling, where it takes the unrolled loops and tries to parallelizee them, but it's not a smoking gun as it's actually pretty unlikely that you can just take source code written without any threading in mind, apply the autovectorizer, and get meaningful improvements, and sometimes it can actually make things worse.

https://msdn.microsoft.com/en-us/library/hh872235.aspx
https://en.wikipedia.org/wiki/Automatic_vectorization

Gaming build:

CPU: i7-7700k (5.0ghz, 1.312v)

GPU(s): Asus Strix 1080ti OC (~2063mhz)

Memory: 32GB (4x8) DDR4 G.Skill TridentZ RGB 3000mhz

Motherboard: Asus Prime z270-AR

PSU: Seasonic Prime Titanium 850W

Cooler: Custom water loop (420mm rad + 360mm rad)

Case: Be quiet! Dark base pro 900 (silver)
Primary storage: Samsung 960 evo m.2 SSD (500gb)

Secondary storage: Samsung 850 evo SSD (250gb)

 

Server build:

OS: Ubuntu server 16.04 LTS (though will probably upgrade to 17.04 for better ryzen support)

CPU: Ryzen R7 1700x

Memory: Ballistix Sport LT 16GB

Motherboard: Asrock B350 m4 pro

PSU: Corsair CX550M

Cooler: Cooler master hyper 212 evo

Storage: 2TB WD Red x1, 128gb OCZ SSD for OS

Case: HAF 932 adv

 

Link to comment
Share on other sites

Link to post
Share on other sites

16 hours ago, Ryan_Vickers said:

Given a typical program that's probably not already multi-threaded to the maximum possible degree, in theory this could be done, but there's two issues:

  • The processor or some other mechanism would have to figure out what parts of the program can be split up on the fly.  I can't even imagine how difficult (not to mention demanding) this would be.
  • At some point, you get down to indivisible workloads.  At this point there's just no way to split it further.  If you could, that would really be a holy grail of sorts since no longer would CPUs have to trade off between multi-core and single-core performance - any task could just use the whole CPU and it would be amazing.

Actually, this is sort of like speculative execution (the good ol' thing that led to Spectre and Meltdown).

 

In general to the original topic creator.  In theory you could create a program that looks ahead in the code and starts execution of code that is thought to be run or independent from the currently running code, but the issue with programs written in single threads is that they tend to just share data (which means you can't just separate them and run the code, without probably doing some very tricky analysis, but this would probably be slower than just running the thing anyways)

3735928559 - Beware of the dead beef

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×