Home > PHP Framework > Workerman > body text

Is workerman multi-threaded?

(*-*)浩
Release: 2019-12-05 10:53:05
Original
2144 people have browsed it

Workerman has a MT multi-threaded version that relies on the pthreads extension. However, because the pthreads extension is not stable enough, this Workerman multi-threaded version is no longer maintained.

Is workerman multi-threaded?

Currently Workerman and its peripheral products are based on multi-process and single-thread. (Recommended learning: workerman tutorial)

Coding specifications in WorkerMan

1. Classes are capitalized Camel case naming, the class file name must be the same as the internal class name of the file for automatic loading. For example:

class UserInfo
{
...
Copy after login

2. Use a namespace. The namespace name corresponds to the directory path, and is based on the developer's project root directory.

For example, in the project MyApp/, the class file MyApp/MyClass.php is in the project root directory, so the namespace is omitted. The class file MyApp/Protocols/MyProtocol.php because MyProtocol.php is in the Protocols directory of the MyApp project, so the namespace Protocols must be added; as follows:

namespace Protocols;
class MyProtocol
{
....
Copy after login

3. Common function and variable names use The format is lowercase and underlined, for example

$connection_list = array();
function get_connection_list()
{
....
Copy after login

4. Class members and class methods are in camel case with the first letter in lowercase, for example:

public $connectionList;
public function getConnectionList();
Copy after login

5. Function and class parameters are in lowercase and underlined

function get_connection_list($one_param, $tow_param)
{
....
Copy after login

The above is the detailed content of Is workerman multi-threaded?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!