Does a handle belong to a windows operating system?

Source: Internet
Author: User
Is the handle specific to the concept of a windows operating system? why do we need to raise this question? it seems that this logic is often used in PHP, so I want to understand it. Baidu once seems that the handle is a product in windows, so does another system, such as Linux and UINX, also have this stuff? There is also the concept of hooks. it seems that the handle is also a hook, so what is the hook? PHP is messy.
Also, $ _ mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms'); in this sentence, why do we say $ _ mysqli is the handle?
I understand it as a variable.


Reply to discussion (solution)

Handle
N. [built] handle; feel; solid mouth
Vt. processing; Operation; use; sales; touch
Vi. handling; easy to manipulate

Handle for habitual translation
Actually, it is the index of system resources.

It is obviously better to pass only the index number of a resource entity in a program.

In php
$ _ Mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms ');
$ _ Mysqli is an object. of course, the object's reference is also a handle.
$ _ Mysql = mysql_connect ('cocalhost', 'root', 'angfan ');
$ _ Mysql is a resource, that is, a handle

Handle
N. [built] handle; feel; solid mouth
Vt. processing; Operation; use; sales; touch
Vi. handling; easy to manipulate

Handle for habitual translation
Actually, it is the index of system resources.

It is obviously better to pass only the index number of a resource entity in a program.

In php
$ _ Mysqli = new mysqli ('cocalhost', 'root', 'angfan ', 'cms ');
$ _ Mysqli is an object. of course, the object's reference is also a handle.
$ _ Mysql = mysql_connect ('cocalhost', 'root', 'angfan ');
$ _ Mysql is a resource, that is, a handle


What is the difference between variables and resources?

Let's just say:
Resources actually exist, such as you.
A variable is a carrier or a name. For example, your ID card will never be shopnc_02, but he represents you.

A handle is a memory block or object managed by a system (such as a database or an operating system). It is not a window concept.

In the window, the reference of the form is the handle. this is because it is officially called, and then the function such as HWND hWnd = AfxGetMainWnd ()-> m_hWnd; you can see that this type of name is the handle.

In fact, the opened files open directories open database connections can be called handles, but not everyone is called this. they are all called "database connections" "file descriptors"

In PHP, you can assign a resource as a handle.

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.