Java Tutorial 16: Hello Multi-Threading!

preview_player
Показать описание
Hello everyone! Today in Java, we are going over simple multithreading in Java, and using it to calculate Prime Numbers. The code for this is not optimized-the isPrime function could be improved a ton and could be a lot faster, but that's not the point of this tutorial :)
Download link is a Zip file, containing all two source files in both .java and .txt format, compiled class files (for command line use), a compiled jar of the program (test it out for yourself!) and a sample output with primes up to the millions.

If you need any help, don't be shy! Comment section is here for a reason :)
Рекомендации по теме
Комментарии
Автор

I love your tutorials - you make them eezy-breezy. There are many of us who really appreciate this style.

NinaHProductions
Автор

Thank you for this video. I am working on a multi-threaded state machine, and your threading tutorial has sent me on my way splendidly.

tylerbtz
Автор

Very informative and to the point, great video maxwell :)

RHCPhooligan
Автор

I learned a lot from this video so thanks for that. With that said, I feel like this video could've been half the duration if you didn't correct yourself so frequently.

xnmad
Автор

Hey man! You deserve more subs! You' re GREAT

rhbvkleef
Автор

Great intro to multi-treading, thanks!

therapy
Автор

Useful I like your speed, if its slow i sleep in lectures.

Analyticsu
Автор

Hi! Thanks for your tutorial!
As a side note, it would be nice, if you'd spoke more about why and how threading works. At the moment, you practically just build us an simple thread program.

Thanks for making the video :)

mihkellukats
Автор

Thanks ! great tutorial spcially the tone and pace is good to pick fast and smooth. We programmer speak fast pick fast :P

johnwyn
Автор

I've never seen anyone get off topic more

calebshedd
Автор

Hi Maxwell. 

I am not able to understand how each thread is getting different series of numbers to find prime numbers. It looks to me that each thread is calculating prime number between 1 and and not afterwards. Also the POC you have explained through the usage of join method is not clear to me.

neerajmahajan
Автор

Hi there, just a question about multi threading for web crawler in java, is it good to implement multi threading crawler that will crawl multiple web sites at the same time instead of single one, because i heard that multi threading is not always good. just let me from your understanding to multi threading will it be good to use it in such application. thanks

chihabahmed
Автор

can you please explain threading concept with its all keywords i.e.synchronized wait notify/notifyall etc with simple examples.

Hamzakhan-bzlo
Автор

Question is there a way to keep track of the threads? So it could do something like -
Have 5 threads launch and assign a value of 1-5 to each. So thread 1 would get 1, 2 would get 2, 3 would get 3 etc..
When a thread finishes have it report back and then launch another thread that gets the value assigned of the thread that was ended?

kevinflabbergasted
Автор

Can you do a flickering checker box program?

ChrisBrennan-Cristophsn
Автор

Yeah, #16 is the most recent tutorial as of late December. More tutorials are coming though :)

TheBestMacTutorials
Автор

thx :)
Threads arent hard if u think about it...
people make this overcomplicated, but thanks for making it simple.

pilliphanikumar
Автор

I understand what join() does but the code to join 4 thread and printing which thread just finished was very confusing to me. Is it correct that when "Thread 0 finished!" gets printed on the console the Thread 1 and all others are yet to join the main thread? Is this correct?

zerziszain
Автор

hello thank you I have a question do every applications need multi threading?

danarj
Автор

hello i need to know haw i can leave to computer talk to each other
i use multi thread to creat chat in java

wejdannalghamdi
join shbcf.ru