Тёмный

Unity DOTS: C# Job System 

Wilmer Lin GA School
Подписаться 12 тыс.
Просмотров 20 тыс.
50% 1

In this episode, we look at the C# Job System, which helps you write multithreaded code.
Also check out the previous videos in this series:
Unity DOTS: Creating an Entity
• Unity DOTS: Creating a...
Unity DOTS: Conversion Workflow
• Unity DOTS: Conversion...
Unity DOTS: Components and Systems
• Unity DOTS: Components...
Want to learn more about DOTS and ECS? Sign up for our mailing list to get notified when the premium course releases:
gameacademy.school/1109-2/
Want to support this channel? Subscribe to our premium courses at GameAcademy.school:
gameacademy.school/portfolio/
Let’s build something cool together!

Опубликовано:

 

7 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 30   
@BIMLOVEYJY
@BIMLOVEYJY 3 года назад
after checking others vids about job system, this one is much more understanding than others
@StarContract
@StarContract 3 года назад
Tutorial was such high tier I watched it even though I am not using Unity but still wanted to learn about multithreaded job systems
@lisandroCT
@lisandroCT 3 года назад
I think it's the first time I've seen a video with several thousands of views with _0_ dislikes.
@unclerandy398
@unclerandy398 3 года назад
@Dev Kothari 1 dislike ;(
@victorjechiu9465
@victorjechiu9465 4 года назад
Best teacher 🔥. Thank you👍
@tony5542
@tony5542 4 года назад
That was the best explanation so far. Thanks a lot.
@qin6409
@qin6409 Год назад
thank you, I bought your courses even though I really don't need them, I just want to support you're made so good and easy understanding video! saved my a lot of time for DOTS learning
@lkhprime
@lkhprime 4 года назад
Thank you so much for the video. A_A
@shirosurfer8864
@shirosurfer8864 4 года назад
Thinking of jobs as a struct(the value type) really helps out in the correct way on thinking about its requirements and life cycle. Ty.Cool
@arashpix
@arashpix 4 года назад
Good job in explaining job systems :)
@FREDO-py4ti
@FREDO-py4ti 3 года назад
You've talent to explain complicate things !!!
@sconosciutosconosciuto2196
@sconosciutosconosciuto2196 4 года назад
Awesome videos :D
@sabrango
@sabrango 4 года назад
THX!
@RomanNaumov
@RomanNaumov 3 года назад
You are the best. Thank you :)
@anonymoussloth6687
@anonymoussloth6687 3 года назад
why do we need to dispose the native array when we provide an allocator.temp which tells it that it only last 1 frame like you said? If we do dispose it manually, why the allocator?
@RockoShaw
@RockoShaw 2 года назад
Hello first of all thank you for your great series of tutorial, you even created a useful playlist for DOTS that let's us go through each topic in a logical sequence step by step, they are also great because are up to date which is hard to find, also the visual aids you put are great and helpful. I have a question regarding jobs. When doing an IJob it's pretty clear how to output data as you explained it. If one decide to use SystemBase and use ScheduleParallel for a ForEach, how does one output a result/value?
@thedeltastrat
@thedeltastrat 2 года назад
Literally exactly what I need to know as well! Would be really useful if u could do a vid on this (if u haven't already, I haven't checked yet). Another thing I'd be interested in knowing is what the different Ijobs mean. Eg: IjobParalellFor, IjobChunk, etc. The only one I knew before was IjobForEach, but that's outdated now.
@burakgok2909
@burakgok2909 3 года назад
Hello, I would like to understand one thing clear when we use the job system its blocks the main thread ( main thread has to wait until the job gets done) right? It's similar to using thread.join( ). I want to know what is the reason for blocking the main thread since it will make the application unresponsive? why they don't work concurrently? Thank you for the tutorials .
@duthcgamerking
@duthcgamerking 3 года назад
Otherwise physics rendering and stuff get desynchronized
@petrusion2827
@petrusion2827 3 года назад
That is very much not the case. There's a very high chance you are using jobs by scheduling them and calling Complete() immediately, aren't you? Obviously, Complete() has to wait until the job is complete. The usual way of using jobs efficiently is to schedule them in Update() and Complete() them in LateUpdate() or schedule them in either one of the Update methods and Complete() them the next frame.
@chethansiqaandiostuff7365
@chethansiqaandiostuff7365 3 года назад
I am getting the following error ,do you know how to fix it : A Native Collection has not been disposed, resulting in a memory leak. Allocated from: Unity.Collections.NativeArray`1:.ctor(Byte[], Allocator) UnityEngine.Networking.UploadHandlerRaw:.ctor(Byte[]) UnityEngine.Networking.UnityWebRequest:SetupPost(UnityWebRequest, WWWForm) UnityEngine.Networking.UnityWebRequest:Post(String, WWWForm)
@gawer33
@gawer33 4 года назад
will this affect mobile gaming, like battery life and heat problem?
@n3on440
@n3on440 4 года назад
more threads used = more power used, higher temperatures, much higher performance
@petrusion2827
@petrusion2827 3 года назад
@@n3on440 That might be true, but consider that with the Burst Compiler, you are able to make code that completes the operation needed much faster and thus save energy, especially if you take the time to learn how to correctly use the explicit SIMD vector types like float4 or int3 provide.
@ssmasrour
@ssmasrour 4 года назад
Awesome, But!!! where is the source code link!? your code link help me to review whatever passed in your video once again
@GameAcademySchool
@GameAcademySchool 4 года назад
Sahab Masroor This was so simple there is no repo. Plus the syntax changes as you go to ECS
@Jigernaunt
@Jigernaunt 4 года назад
So in this video there are no answers to the questions of how actually job system achive parallel computation, when we need to use job system, what is the benifit of job system in comparision to thread pool. You just showed how to work with job API on a kinda useless example.
@GameAcademySchool
@GameAcademySchool 4 года назад
Dmitry Osipov Yes this just shows a very basic example to introduce people to the concept and syntax
@petrusion2827
@petrusion2827 3 года назад
I thought the exact same thing too when I started to learn to use the job system. I also thought that it is just a weird ThreadPool. But it turns out the Job System is much better for games than Tasks. - The job system does not create any Garbage Collector pressure. When you make a Task, you are making the Task object, the delegate object and possibly the Thread object. Garbage Collection is something you mostly want to avoid in game development. - The job system avoids context switches much much much better than the ThreadPool. If you make 100 Tasks in a frame, they are very likely going to create a lot of OS Threads. The Job system has its worker threads to which it feeds jobs, which makes sure you run into very few context switches as opposed to the ThreadPool. - The job system has the Burst Compiler, which is, hands down, the most powerful feature it boasts. Burst jobs are one of the if not the best way of creating extremely optimized native code that will try its hardest to vectorize itself. Also, with Unity.Mathematics library you can even use explicit SIMD which is amazing. You can even see a very detailed description of how the Burst code compiles in the Burst Inspector.