Tak si to precitaj este raz. Ak to mas problem pochopit. Sice sa tam pise, ze "lock-free", ale hned v tej istej citacii mas ze zamykanie sa pouziva pri zapise. Teda, lock-free to je len v tych 95% pripadoch, kedy sa cita.
Modifikacia = zapis/prepis dat = LOCK.
Pokial su data zamnknute, nikto iny s nimi nemoze pracovat, teda ani iny thread ich citat, alebo prepisat. Nedojde k strate integrity.
Ak sa data nemodifikuju, tak nie su zamknute, teda ako 20 threadov naraz chce na 20 jadrach citat, tak to proste precitaju naraz a subezne, bez toho aby sa to muselo zamykat a citat jeden po druhom.
Lenze oni nepovolili zapis/prepis bez zamykania.
Ak sa ti nepacia petrikove prispevky, tak na ne nereaguj. Neviem co sa ti nepaci na petrikovej kulture prejavu, zatial som si nikde nevsimol, aby napadal teba a tvoju intelingenciu (zato ty jeho ano).
V clanku je pekne rozobrate, ze pouzivaju rozne "druhy" threadingu a rozne pristupy. Staci sa pozriet na tie obrazky.
Takze o co ide:
Teda renering bezi na jednom jadre. Ai na inom, fyzika na dalsom. Myslim ze AI a fyzika bola celkom dobra uz v hl2, takze tymto vlastne menia uz aj gro hry.Coarse threading: is the process of taking whole systems and putting them on to individual cores. It's a conceptually simple task to put rendering on one core, AI on another, physics on another and so on. Tom continues, "This essentially allows these systems to stay single threaded, and they only have to be multithreaded when it comes to synchronising them to a timeline thread to put them all back in order."
Takze do threadov rozdeluju uz aj "single threaded veci", ktore same o sebe bezia dost dlho na to, aby malo zmysel ich delit a znova spajat. Napr. cyklus, ktory sa iteruje 1000x (a v kazdom ktoru napr. modifikuje nejaky objekt) rozdelis medzi viacero jadier, kazde z nich vykona nejaku inu iteraciu z tych 1000. Ale hned sa tam aj pise, ze toto je velmi tazke dosiahnut a neda sa to vyuzit vsade, takze to maju pouzite iba tam, kde sa im to podarilo rozumne implementovat. Myslim ze toto zasahuje aj do "gra enginu".Fine-grain threading: takes a more intricate approach. The idea behind this method of threading is to take many similar or identical tasks and spread them across cores - for example, taking a loop that iterates over an array of data. In the case of a 1000 loop process, you just split it up by the number of cores. You need to make sure that each of the operations is independent and doesn't affect another data set - but this is tricky to do, because the time per work unit can be variable and managing the timeline of outcomes and consequences can get difficult.
a nakoniec:
Teda tu sa pise, ze napr. zvuk dali do oddeleneho threadu. To myslim tiez zasahuje do gra hry. Tiez treba este brat v uvahu, kolko ludi ma SB audigy, a kolko ma integrovanu "softwareovu" zvukovku na doske - u tychto ludi je spracovanie zvuku este narocnejsie na procesor.Hybrid threading: is the approach that Valve eventually decided to take. It is, you'll be unsurprised to learn, a mixture of coarse and fine threading. "It's attempting to use the appropriate tool for the job in multiple combinations," according to Tom. "So, some systems operate really well just being parked on a core - an example is sound mixing. It doesn't really interact, doesn't really have a frame constraint, it works on its own set of data, and so it's really happy being pushed off."
a este...
Nebavili sme sa tu niekolko stranok dozadu, ze rendering sa neda /sa velmi zle paralelizuje? Valve to zvladli. A teraz otazka - bude episode 2 3x drahsia (ako tu eagle tvrdi ze multithreaded vyvoj je 3x drahsi) ako episode 1? Nemyslim.Hybrid rendering: One example is in calculating what is going to be rendered, and this relies on a critical part of the Steam engine, the 'world list'. "We first have to figure out - what are the areas of the BSP that you're going to render? Then, okay, what objects are in those portions? Up until the point that you're actually going to draw them, you're CPU bound. You have to work out all these calculations from multiple points of view - the player's view, then say, the view of TV monitors in the scene, then the point of view of reflections in water."
"To apply a hybrid threading model, we revised the pipeline. Now, we construct the rendering list from the world list in parallel - we can calculate the TV, water and player rendering lists at the same time across cores. We can then do things like running all the character bone transforms across the cores, too."
Tiez mam nejake take tusenie, ze unreal engine 3 bude do istej miery vyuzivat mutithreading (aspon tak, aby vedel rozumne vyuzit druhe jadro)
no mne to dost casto pripada ako, protože JÁ a ostatní me nezajíma.