In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Process
-
1. Processes are isolated in memory (memory is not shared).
two。 Communication between processes is through socket, which is also needed on the same computer.
Thread
-
1. A block of code that executes concurrently during program execution.
two。 Memory is shared between threads.
3. A process must have at least one thread (the main thread).
4.Thread: thread class.
Start (); / / notifies cpu that you can start executing the thread.
The block of code that the run (); / / thread actually executes. The method has no return value and no parameters.
Thread t = new Thread (); / / create a thread.
T.start (); / / run.
5.Thread.currentThread (); gets the currently executing thread.
6.yield (); / / waive the preemption right of cpu
7.sleep (int mils) / / hibernates the current thread for the specified number of milliseconds.
8.join (); / / wait for the specified thread to finish
9.Thread.setDaemon (true); / / daemon thread. Must be set before the thread starts.
10.synchronozed (lock) {.} / / synchronize the code block.
Producers and consumers
Notify: randomly notifies a thread in the waiting queue.
NotifyAll: notifies all threads in the waiting queue.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.