欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

handle和handler的理解

发布时间:2023/12/15 编程问答 49 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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则是一个异步的回调函数(子程序)

总结

以上是生活随笔为你收集整理的handle和handler的理解的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。