Go Live555 Single Thread principle

Source: Internet
Author: User

1. Overview

In the Live555-server library, the use of single-threaded implementation of multi-user requests for video data, which seems to be multi-threaded to achieve the function, and the user requests the video data flow convergence is perfect, its execution is very efficient.

How is live555 implemented single-threaded? What is the reference point of its powertrain system?

2. Power system principle

An irrelevant topic:

Someone a has a bunch of tasks to handle, but he can only do one task at a time (single-threaded), sometimes for one task will trigger other tasks, and sometimes others will continue to explain the task, and the task has priority and priorities. A how to complete the task in accordance with certain rules.

The arrangements for a are as follows:

Write each separate task on a note, put it in the manager, and take one of the most urgent notes from the manager each time; When the task is triggered by another task, a new note is put into the manager, and if someone is explaining a new task, write a new note into the manager. A in the manager before taking the note, you must first ask if there is someone to arrange a new task for him, so that a can be timely to accept the tasks assigned by others.

The basic process of a is as follows:

This is a strict requirement for each task of a processing, that is, the task processing time is short, can not wait or sleep in the process of processing the task.

Basic operation of the task:

For tasks placed in the list, synchronization tasks are required before each task is taken out, not sequentially.

The corresponding relationship is as follows:

The topic loop corresponds to the Basictaskscheduler::singlestep function.

1. Ask if a task has been scheduled:

Select the socket section and the Select function. Here you need to understand the use of the Select function.

2. Task Manager corresponding to the Fdelayqueue variable, in the manager to take the task to handle the corresponding Fdelayqueue.handlealarm ()

3. Put the task in the manager for the corresponding

EnviR (). TaskScheduler (). Scheduledelayedtask function

For live555 have any other questions, please email to [email protected], we all a discussion.

Transferred from: http://blog.csdn.net/wjh_monkey/article/details/42024427

Go Live555 Single Thread principle

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.