handle和handler的理解

维基百科对handler的解释:

Handler, an asynchronous callback (computer programming) subroutine in computing
...
Event handler, a routine for processing a programming event
Interrupt handler, a routine for processing CPU interrupts
Signal handler, a routine for handling signals sent to a process
Exception handler, a routine for handling software exceptions

维基百科对handle的解释:

In computer programming, a handle is an abstract reference to a resource. 
Handles are used when application software references blocks of memory or 
objects managed by another system, such as a database or an operating system. 
A resource handle can be an opaque identifier, in which case it is often an 
integer number (often an array index in an array or "table" that is used to 
manage that type of resource), or it can be a pointer that allows access to 
further information.

Common resource handles are file descriptors, network sockets, 
database connections, process identifiers (PIDs), and job IDs. 
Process IDs and job IDs are explicitly visible integers, while file descriptors 
and sockets (which are often implemented as a form of file descriptor) are 
represented as integers, but are typically considered opaque. In traditional 
implementations, file descriptors are indices into a (per-process) file 
descriptor table, thence a (system-wide) file table.

总结来说

A handle  is an abstract reference to a resource. Handle是对某个资源的抽象引用。
A handler is an asynchronous callback subroutine. Handler则是一个异步的回调函数(子程序)
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值