Home >PHP Framework >Workerman >Is workerman multi-threaded?

Is workerman multi-threaded?

(*-*)浩
(*-*)浩Original
2019-12-05 10:53:052215browse

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
{
...

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
{
....

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

$connection_list = array();
function get_connection_list()
{
....

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

public $connectionList;
public function getConnectionList();

5. Function and class parameters are in lowercase and underlined

function get_connection_list($one_param, $tow_param)
{
....

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

Statement:
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