zoukankan      html  css  js  c++  java
  • MessageQueue 相关概念

    /**
     * Implements a thread-local storage, that is, a variable for which each thread
     * has its own value. All threads share the same {
    @code ThreadLocal} object,
     * but each sees a different value when accessing it, and changes made by one
     * thread do not affect the other threads. The implementation supports
     * {
    @code null} values.
     *
     *
    @see java.lang.Thread
     *
    @author Bob Lee
     */
    public class ThreadLocal<T>

    /**
      * Class used to run a message loop for a thread.  Threads by default do
      * not have a message loop associated with them; to create one, call
      * {
    @link #prepare} in the thread that is to run the loop, and then
      * {
    @link #loop} to have it process messages until the loop is stopped.

    public final class Looper 

    /**
     *
     * Defines a message containing a description and arbitrary data object that can be
     * sent to a {
    @link Handler}.  This object contains two extra int fields and an
     * extra object field that allow you to not do allocations in many cases. 
     *
     *
    While the constructor of Message is public, the best way to get
     * one of these is to call {
    @link #obtain Message.obtain()} or one of the
     * {
    @link Handler#obtainMessage Handler.obtainMessage()} methods, which will pull
     * them from a pool of recycled objects.
    </p>
     */
    public final class Message implements Parcelable

    /**
     * Low-level class holding the list of messages to be dispatched by a
     * {
    @link Looper}.  Messages are not added directly to a MessageQueue,
     * but rather through {
    @link Handler} objects associated with the Looper.
     *
     *
    <p>You can retrieve the MessageQueue for the current thread with
     * {
    @link Looper#myQueue() Looper.myQueue()}.
     */
    public final class MessageQueue

    /**
     * A Handler allows you to send and process {
    @link Message} and Runnable
     * objects associated with a thread's {
    @link MessageQueue}.  Each Handler
     * instance is associated with a single thread and that thread's message
     * queue.  When you create a new Handler, it is bound to the thread /
     * message queue of the thread that is creating it -- from that point on,
     * it will deliver messages and runnables to that message queue and execute
     * them as they come out of the message queue.

    public class Handler

  • 相关阅读:
    数据倾斜原理及解决方案
    删除emp_no重复的记录,只保留最小的id对应的记录
    理解HBase面向列存储
    给数据库用户授权(对象多为系统表,如dba可以查看的表)
    SpringBoot里的一些注解
    01背包
    【转】简说GNU, GCC and MinGW (Lu Hongling)
    费马小定理
    欧拉定理
    【转】C中的静态存储区和动态存储区
  • 原文地址:https://www.cnblogs.com/feng9exe/p/5726051.html
Copyright © 2011-2022 走看看