, what to do, that is, user goals.
With a goal, there is a natural starting point. Just like taking the subway, there are many sites at the beginning to the end. In the physical world it is impossible to cross these intermediate sites. Interactive design is the same, the user in order to complete this goal, the designer needs to decompose this goal, on the reasonable arrangement of these sites, convenient for users to complete each small task simple and smooth. Each subtask must have clear acti
business logic. Master-worker mode (can be used to prepare data before data migration, multiple processes collect data and compute results asynchronously)
The master process is the primary process, maintaining a worker process queue, child task queues, and child result sets. The worker process in the worker process queue extracts the subtasks to be processed from the task queue and writes the results of the subta
Case analysis
Front desk asynchronous upload file to cloud background cron
*/10 * * * */usr/local/bin/php/path/to/upload.php >>/tmp/apkqueue.log
Sometimes uploading a file to the cloud can be time-consuming, a cron has not run out, the next cron is turned on, and a file may be uploaded at the same time as a cron.
If the execution time of a script is much larger than that of Cron, the system will have multiple identical scripts executing simultaneously. If the script's
Cluster:
A cluster is a group of service entities that work together to provide a service platform that is more scalable and available than a single service entity. In the view of the client, a cluster is like a service entity, but in fact the cluster consists of a set of service entities. The cluster provides the following two key features compared to a single service entity:
Scalability--The performance of the cluster is not limited to a single service entity, and new service entities can dy
, or create conditions for the next action. This level can be considered machine instruction level, the operating system level of instruction is derived from this level. Now, we all know clearly that any instruction set is a simple combination of its next level of instruction set. The task that the office clerk wants to complete is actually a series of subtasks. These subtasks are grouped together to form a
have at least one thread, that is, when a process is created, it is automatically assigned a thread, which is called the "main thread." But then again, this thread is no different than the thread created by this process, and it just happens to be the first thread of the process. In general, under the control of the program, the number of threads in the process changes at run time, any thread can create other threads, but anyway, the thread does not own the thread it creates, and all threads wit
the business is inaccessible.
2: To put it simply, distributed is to improve efficiency by shortening the execution time of a single task, while clustering increases efficiency by increasing the number of tasks executed per unit of time.
For example, if a task consists of 10 subtasks, each of which takes 1 hours to execute separately, it takes 10 hours to perform the task on a single server.
The distributed scheme provides 10 servers, each server i
, but because the CPU is executing too fast, we feel as if all the tasks are executing at the same time.
True parallel multitasking can only be done on multicore CPUs, but because the number of tasks is much larger than the number of cores in the CPU, the operating system automatically shifts many tasks to each core.
For the operating system, a task is a process, such as open a browser is to start a browser process, open a notepad started a Notepad process, open two Notepad started the two Notep
Android interview, IntentService principle and usage, androidintent
In Android development, we may encounter such a business requirement. A task is divided into several subtasks, which are executed in sequence. After all the subtasks are executed, this task is successful. This can be achieved by using several sub-threads for sequential execution, but each thread must be manually controlled, and another sub-
method invocation;2) Although the Thread1 start method call is called before the Thread2 Run method, the first output is information about the Thread2 Run method call, stating that the process created by the new thread does not block subsequent executions of the main thread.2. Implement the Runnable interfaceCreating Threads in Java In addition to inheriting the thread class, you can implement similar functionality by implementing the Runnable interface. Implementing the Runnable interface must
short, the distributed architecture improves the efficiency by shortening the execution time of a single task, while the cluster improves the efficiency by increasing the number of tasks executed per unit time.The following is a simple example:If a task is composed of 10 subtasks, it takes one hour for each subtask to be executed separately, it takes 10 hours to execute the task on a server.The Distributed Solution Provides 10 servers. Each server is
the CPU is executing too fast, we feel as if all the tasks are executing at the same time.
true parallel multitasking can only be done on multicore CPUs , but because the number of tasks is much larger than the number of cores in the CPU, the operating system automatically shifts many tasks to each core.
For the operating system, a task is a process, such as open a browser is to start a browser process, open a notepad started a Notepad process, open two Notepad started the two Notepad process
breaks down into a series of subtasks, then calls the connected service, Saver service in all subtasks to get online and offline related users, and then collectively pushes to the room Service, so the whole cluster is under a lot of pressure at that moment. It can be seen that the whole system communication is more complex, and the structure after disassembly also has very heavy logic. Go language Construc
responsible for processing user requests, based on the Partition key, the user's request is divided into multiple subtasks and processed in parallel by different partitions. Finally, the execution results of different partitions are summarized and returned to the user. The corresponding partitions are transparent.
In DB2, database partitions can be deployed in clusters or MPP environments, that is, database partitions are distributed on different mac
The core architecture of Informix Dynamic servers is designed to provide built-in multi-clue and parallel processing capabilities.Multi-clue On the database server, the Informix dynamic server uses an adjustable database server process pool called a 'virtual processor 'to plan and manage user requests. User requests are expressed through a lightweight mechanism called "clues". Clues are a single and consistent control flow used to express an independent task in the database server process.When a
, such as Word, which can perform typing, spelling check, printing, and so on at the same time. In a process, to do multiple tasks at the same time, you need to run multiple "subtasks" at the same time. We call these "subtasks" in the process as threads ).
Since each process must do at least one thing, a process must have at least one thread. Of course, a complicated process like Word can have multiple thre
).Two. Why are threads present?After the process has occurred, the performance of the operating system has been greatly improved. Although the development of the process solves the concurrency problem of the operating system, people are still not satisfied, people gradually have a demand for real-time. Because a process can only do one thing in a period of time, if a process has more than one subtask, you can only perform these subtasks on a per-task
Real Application Cluster nodes based on the current workload, features, and query importance.
As long as the statements are optimized and parallelized, you can know all subsequent parallel subtasks. The original process becomes the query Coordinator. The PX server of the parallel processing server is allocated from the public buffer pool of the parallel processing server on one or more nodes, and the operation is executed in parallel.
Similar to a no
Heredoc Original document and Nowdoc syntax using scene code
'; foreach ($parent as $task _id = $todo) {echo
$todo EOT; if (Isset ($tasks [$task _id])) {//If the current ID has subtasks, the menu make_list is created recursively ($tasks [$task _id]); } echo ""; } Echo ''; } $db = Mysqli_connect (' 192.168.31.172 ', ' root ', ' root ', ' phpadvanced '); Mysqli_query ($db, "Set names UTF8"); if
processing user requests, based on the Partition key, the user's request is divided into multiple subtasks and processed in parallel by different partitions. Finally, the execution results of different partitions are summarized and returned to the user. The corresponding partitions are transparent.
In DB2, database partitions can be deployed in clusters or MPP environments, that is, database partitions are distributed on different machines. Database
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.