Activity的啟動流程

Activity的啟動流程


努力工作

自己平時工作接觸的frameworks代碼比較多,但真正理解的很有限,一直在努力分析。。我主要還是用補丁的形式來看


 core/java/android/app/Activity.java                |  6 +++core/java/android/app/ActivityManagerNative.java   | 14 ++++-core/java/android/app/ActivityThread.java          | 63 +++++++++++++++++++++-core/java/android/app/ApplicationThreadNative.java |  7 +++core/java/android/app/IApplicationThread.java      |  8 +++core/java/android/app/Instrumentation.java         | 16 ++++++.../android/server/am/ActivityManagerService.java  | 10 +++-.../java/com/android/server/am/ActivityStack.java  | 12 ++++-.../android/server/am/ActivityStackSupervisor.java | 51 +++++++++++++++++-9 files changed, 181 insertions(+), 6 deletions(-)diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 4b705dd..527cc38 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -3731,6 +3731,12 @@ public class Activity extends ContextThemeWrapper** @see #startActivity*/
+
+    /**
+     *Created by Smaster / one;
+     *  mParent代表的是ActivityGroup, ActivityGroup最開始被用來在一個界面中嵌入多個Activity.
+     *  --> Instrumentation execStartActivity()方法
+     * */public void startActivityForResult(Intent intent, int requestCode, @Nullable Bundle options) {if (mParent == null) {Instrumentation.ActivityResult ar =
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java
index 4e2ff0b..6ca7a32 100644
--- a/core/java/android/app/ActivityManagerNative.java
+++ b/core/java/android/app/ActivityManagerNative.java
@@ -78,6 +78,11 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM/*** Retrieve the system's default/global activity manager.*/
+    /** 
+     * created by Smaster / three;
+     *
+     *
+     * */static public IActivityManager getDefault() {return gDefault.get();}
@@ -2337,7 +2342,14 @@ public abstract class ActivityManagerNative extends Binder implements IActivityMpublic IBinder asBinder() {return this;}
-
+    
+    /**
+     *created by Smaster / four;
+     * 單利封裝, 在后續的調用中直接返回之前創建的對象。
+     *
+     * ----> AMS startActivity.
+     *
+     * */private static final Singleton<IActivityManager> gDefault = new Singleton<IActivityManager>() {protected IActivityManager create() {IBinder b = ServiceManager.getService("activity");
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index dd49009..6ef3729 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -545,7 +545,21 @@ public final class ActivityThread {}private native void dumpGraphicsInfo(FileDescriptor fd);
+ 
+    /**
+     * created by Smaster / nineteen;
+     *   繼承ApplicationThreadNative, ApplicationThreadNative 繼承Binder ;
+     *   并實現IApplicationThread接口,
+     *   類似AIDL 
+     *   ApplicationThreadNative 中&emsp;--> ApplicationThreadProxy類。
+     * */+    /**
+     * created by Smaster / twenty-one;
+     *  再次從ApplicationThreadNative中歸來;
+     *&emsp;ApplicationThread 是真正實現IApplicationThread的類;
+     *  --> scheduleLaunchActivity --> 啟動Activity.
+     * */private class ApplicationThread extends ApplicationThreadNative {private static final String ONE_COUNT_COLUMN = "%21s %8d";private static final String TWO_COUNT_COLUMNS = "%21s %8d %21s %8d";
@@ -603,6 +617,9 @@ public final class ActivityThread {// we use token to identify this activity without having to send the// activity itself back to the activity manager. (matters more with ipc)
+        //
+        // created by Smaster / twenty-two;
+        // sendMessage --> 發送一個消息給H處理。 --> Handler&emsp;中&emsp;Hpublic final void scheduleLaunchActivity(Intent intent, IBinder token, int ident,ActivityInfo info, Configuration curConfig, CompatibilityInfo compatInfo,IVoiceInteractor voiceInteractor, int procState, Bundle state,
@@ -1158,6 +1175,11 @@ public final class ActivityThread {}}+    /**
+     * created by Smaster / twenty-three;
+     *  對消息的處理;&emsp;LAUNCH_ACTIVITY ;
+     *
+     * */private class H extends Handler {public static final int LAUNCH_ACTIVITY         = 100;public static final int PAUSE_ACTIVITY          = 101;
@@ -1266,6 +1288,12 @@ public final class ActivityThread {}return Integer.toString(code);}
+
+        /**
+         * created by Smaster / twenty-four;
+         *  handleMessage(r, null)方法實現;
+         *
+         * */public void handleMessage(Message msg) {if (DEBUG_MESSAGES) Slog.v(TAG, ">>> handling: " + codeToString(msg.what));switch (msg.what) {
@@ -2172,9 +2200,20 @@ public final class ActivityThread {sendMessage(H.CLEAN_UP_CONTEXT, cci);}+    /**
+     * created by Smaster / twenty-six;
+     * 該方法最終完成activity的啓動;
+     * 主要完成六件事;
+     *
+     * . 
+     *
+     * */private Activity performLaunchActivity(ActivityClientRecord r, Intent customIntent) {// System.out.println("##### [" + System.currentTimeMillis() + "] ActivityThread.performLaunchActivity(" + r + ")");
-
+        /**
+         *
+         * 1.從ActivityClientRecord中獲取待啟動的Activity的組件信息;
+         * */ActivityInfo aInfo = r.activityInfo;if (r.packageInfo == null) {r.packageInfo = getPackageInfo(aInfo.applicationInfo, r.compatInfo,
@@ -2195,6 +2234,10 @@ public final class ActivityThread {Activity activity = null;try {
+            /**
+             * 2. 通過Instrumention的newActivity方法使用類加載器創建Activity對象;
+             *
+             * */java.lang.ClassLoader cl = r.packageInfo.getClassLoader();activity = mInstrumentation.newActivity(cl, component.getClassName(), r.intent);
@@ -2213,6 +2256,11 @@ public final class ActivityThread {}try {
+
+            /**
+             * 3. 創建Application 對象;
+             *
+             * */Application app = r.packageInfo.makeApplication(false, mInstrumentation);if (localLOGV) Slog.v(TAG, "Performing launch of " + r);
@@ -2224,6 +2272,12 @@ public final class ActivityThread {+ ", dir=" + r.packageInfo.getAppDir());if (activity != null) {
+                /**
+                 * 4. 創建ContextImpl 對象并通過Activity的attach方法來完成一些重要數據的初始化;
+                 * &emsp;Context的邏輯都是由ContexImpl來完成的。
+                 * &emsp;ContextImpl是通過activity的attach方法來和activity建立關聯。
+                 * &emsp;
+                 * */Context appContext = createBaseContextForActivity(r, activity);CharSequence title = r.activityInfo.loadLabel(appContext.getPackageManager());Configuration config = new Configuration(mCompatConfiguration);
@@ -2248,6 +2302,9 @@ public final class ActivityThread {if (r.isPersistable()) {mInstrumentation.callActivityOnCreate(activity, r.state, r.persistentState);} else {
+                    /**
+                     * 5. finished;i成
+                     * */mInstrumentation.callActivityOnCreate(activity, r.state);}if (!activity.mCalled) {
@@ -2340,6 +2397,10 @@ public final class ActivityThread {return baseContext;}+    /**
+     * created by Smaster / twenty-five;
+     * ---> performLaunchActivity
+     * */private void handleLaunchActivity(ActivityClientRecord r, Intent customIntent) {// If we are getting ready to gc after going to the background, well// we are back active so skip it.
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index 0123e16..544c00d 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -678,6 +678,13 @@ public abstract class ApplicationThreadNative extends Binder}}+/**
+ * created by Smaster / twenty;
+ *  系統AIDL / 
+ *  ApplicationThreadNative 是 IApplicationThread&emsp;的實現者。
+ *  由于ApplicationThreadNative被定義為抽象類,&emsp;所以ApplicationThread就成
+ *  了IApplicationThread的最終實現者。
+ * */class ApplicationThreadProxy implements IApplicationThread {private final IBinder mRemote;diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index f53075c..226fe31 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -47,6 +47,14 @@ import java.util.Map;** {@hide}*/
+
+/**
+ * created by Smaster / eighteen;
+ *  繼承IInterface接口,所以它是&emsp;Binder 類型的接口。
+ *&emsp;包含大量啟動&emsp;/ 停止&emsp;/ Activity的接口。&emsp;和&emsp;停止&emsp;/ 啟動&emsp;服務的接口;
+
+ *   IApplicationThread 中的實現&emsp;---> &emsp;ActivityThread中內部類&emsp;ApplicationThread.
+ * */public interface IApplicationThread extends IInterface {void schedulePauseActivity(IBinder token, boolean finished, boolean userLeaving,int configChanges, boolean dontReport) throws RemoteException;
diff --git a/core/java/android/app/Instrumentation.java b/core/java/android/app/Instrumentation.java
index 60a013e..228f982 100644
--- a/core/java/android/app/Instrumentation.java
+++ b/core/java/android/app/Instrumentation.java
@@ -1482,6 +1482,10 @@ public class Instrumentation {intent.resolveTypeIfNeeded(who.getContentResolver()),token, target != null ? target.mEmbeddedID : null,requestCode, 0, null, options);
+            /**
+             * created by Smaster / five;
+             *  檢查activity的啟動結果
+             * */checkStartActivityResult(result, intent);} catch (RemoteException e) {}
@@ -1632,6 +1636,13 @@ public class Instrumentation {** {@hide}*/
+    /**
+     * created by Smaster / two;
+     *  ---> ActivityManagerNative.getDefault().startActivityAsUser();
+     *  AMS中實現;
+     *&emsp;AMS 繼承&emsp;AMN , AMN繼承Binder 并實現IActivityManager.
+     *  因此,AMS也是一個Binder, 它是IActivityManager的具體實現。
+     * */public ActivityResult execStartActivity(Context who, IBinder contextThread, IBinder token, Activity target,Intent intent, int requestCode, Bundle options, UserHandle user) {
@@ -1749,6 +1760,11 @@ public class Instrumentation {}/** @hide */
+    /**
+     * creatd by Smaster / six;
+     *  當無法正確啟動一個Activity時,這個方法會拋出一個異常信息;
+     *&emsp;當待啟動的Activity沒有在AndroidManifest中注冊時,&emsp;會拋出這個異常;
+     * */public static void checkStartActivityResult(int res, Object intent) {if (res >= ActivityManager.START_SUCCESS) {return;
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 8dfb321..a20d5c3 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -3535,7 +3535,11 @@ public final class ActivityManagerService extends ActivityManagerNative}mProcessObservers.finishBroadcast();}
-
+    
+    /**
+     * created by Smaster / seven;
+     *
+     * */@Overridepublic final int startActivity(IApplicationThread caller, String callingPackage,Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
@@ -3545,6 +3549,10 @@ public final class ActivityManagerService extends ActivityManagerNativeUserHandle.getCallingUserId());}+    /**
+     * creatd by Smaster / eight;
+     * --> ActivityStackSupervisor startactivityMayWait方法;
+     * */@Overridepublic final int startActivityAsUser(IApplicationThread caller, String callingPackage,Intent intent, String resolvedType, IBinder resultTo, String resultWho, int requestCode,
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index e1b8278..dbe3249 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -1467,6 +1467,11 @@ final class ActivityStack {return resumeTopActivityLocked(prev, null);}+    /**
+     * created by Smaster / thirteen;
+     *   --> resumeTopActivityInnerLocked
+     *
+     * */final boolean resumeTopActivityLocked(ActivityRecord prev, Bundle options) {if (inResumeTopActivity) {// Don't even start recursing.
@@ -1483,7 +1488,12 @@ final class ActivityStack {}return result;}
-
+    
+    /**
+     * creatd by Smaster / fourteen;
+     *   --> ActivityStackSupervisor  startSpecificActivityLocked方法
+     *
+     * */final boolean resumeTopActivityInnerLocked(ActivityRecord prev, Bundle options) {if (ActivityManagerService.DEBUG_LOCKSCREEN) mService.logLockScreen("");diff --git a/services/core/java/com/android/server/am/ActivityStackSupervisor.java b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
index 03dd3c0..e3c7ecb 100644
--- a/services/core/java/com/android/server/am/ActivityStackSupervisor.java
+++ b/services/core/java/com/android/server/am/ActivityStackSupervisor.java
@@ -810,6 +810,11 @@ public final class ActivityStackSupervisor implements DisplayListener {0, 0, 0, null, false, null, null, null);}+    /**
+     * created by Smaster / nine;
+     *  --> startActivityLocked;
+     * */
+final int startActivityMayWait(IApplicationThread caller, int callingUid,String callingPackage, Intent intent, String resolvedType,IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor,
@@ -1058,6 +1063,10 @@ public final class ActivityStackSupervisor implements DisplayListener {return ActivityManager.START_SUCCESS;}+    /**
+     * created by Smaster / sixteen;
+     *  
+     * */final boolean realStartActivityLocked(ActivityRecord r,ProcessRecord app, boolean andResume, boolean checkConfig)throws RemoteException {
@@ -1154,6 +1163,25 @@ public final class ActivityStackSupervisor implements DisplayListener {? new ProfilerInfo(profileFile, profileFd, mService.mSamplingInterval,mService.mAutoStopProfiler) : null;app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
+            /* created by Smaster / seventeen;
+             *&emsp;總結: 
+             *       startActivityMayWait
+             *             |
+             *       startActivityLocked
+             *             |
+             *       startActivityUncheckedLocked    ---> resumeTopActivitiesLocked
+             *             | 
+             *       startSpecificActivityLocked     <--- resumeTopActivitiesLocked
+             *             |
+             *       realStartActivityLocked              ActivityStack;
+             *
+             *        ActivityStackSupervisor;
+             *
+             *
+             *
+             *        app.thread的類型為IApplicationThread
+             *
+             * **/app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,System.identityHashCode(r), r.info, new Configuration(mService.mConfiguration),r.compat, r.task.voiceInteractor, app.repProcState, r.icicle, r.persistentState,
@@ -1235,6 +1263,10 @@ public final class ActivityStackSupervisor implements DisplayListener {return true;}+    /**
+     * created by Smaster / fifteen;
+     *  -- > realStartActivityLocked;
+     * */void startSpecificActivityLocked(ActivityRecord r,boolean andResume, boolean checkConfig) {// Is this activity's application already running?
@@ -1269,6 +1301,11 @@ public final class ActivityStackSupervisor implements DisplayListener {"activity", r.intent.getComponent(), false, false, true);}+    /**
+     * created by Smaster / ten ;
+     *  --> startActivityUncheckedLocked方法;
+     *
+     * */final int startActivityLocked(IApplicationThread caller,Intent intent, String resolvedType, ActivityInfo aInfo,IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor,
@@ -1570,7 +1607,12 @@ public final class ActivityStackSupervisor implements DisplayListener {moveHomeStack(isHomeActivity);}}
-
+&emsp;&emsp;/**
+    *created by Smaster / eleven;
+    * 
+    * ---> resumeTopActivitiesLocked();
+    *
+    */&emsp;final int startActivityUncheckedLocked(ActivityRecord r, ActivityRecord sourceRecord,IVoiceInteractionSession voiceSession, IVoiceInteractor voiceInteractor, int startFlags,boolean doResume, Bundle options, TaskRecord inTask) {
@@ -2417,7 +2459,12 @@ public final class ActivityStackSupervisor implements DisplayListener {boolean resumeTopActivitiesLocked() {return resumeTopActivitiesLocked(null, null, null);}
-
+    
+    /**
+     * created by Smaster / twelve;
+     *  ---> ActivityStack&emsp;resumeTopActivityLocked;
+     *
+     * */boolean resumeTopActivitiesLocked(ActivityStack targetStack, ActivityRecord target,Bundle targetOptions) {if (targetStack == null) {
-- 
復制代碼

我會逐漸增加注釋

轉載于:https://juejin.im/post/5b00315d51882542ad7743a2

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/254559.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/254559.shtml
英文地址,請注明出處:http://en.pswp.cn/news/254559.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

es6--箭頭函數

基本用法 ES6允許使用“箭頭”&#xff08;>&#xff09;定義函數。 var f v > v; 上面的箭頭函數等同于&#xff1a; var f function(v) {return v; }; 如果箭頭函數不需要參數或需要多個參數&#xff0c;就使用一個圓括號代表參數部分。 var f () > 5; // 等同于…

halcon Bit圖位像素處理算子,持續更新

目錄bit_andbit_lshiftbit_maskbit_notbit_orbit_rshiftbit_slicebit_xorbit_and 功能&#xff1a;輸入圖像的所有像素的逐位與。 bit_lshift 功能&#xff1a;圖像的所有像素的左移。 bit_mask 功能&#xff1a;使用位掩碼的每個像素的邏輯與。 bit_not 功能&#xff1…

NYOJ題目839合并

--------------------------- AC代碼&#xff1a; 1 import java.util.Scanner;2 3 public class Main {4 5 public static void main(String[] args) {6 7 8 Scanner scnew Scanner(System.in);9 10 int timessc.nextInt(); 11 …

指針的魅力

序 指針說&#xff1a;love me&#xff0c;love me&#xff01; 但是他對指針說&#xff1a;I hate u&#xff0c;I hate u&#xff01; …… 指針僅僅是作為指針&#xff0c;我們可以把它當做有用的工具&#xff0c;為我們提供便利與好處。說起工具不得不讓我想起一樣東西—…

python多進程

2019獨角獸企業重金招聘Python工程師標準>>> python多進程 進程簡介 進程是程序在計算機上的一次執行活動。當你運行一個程序&#xff0c;你就啟動了一個進程。顯然&#xff0c;程序是死的(靜態的)&#xff0c;進程是活的(動態的)。進程可以分為系統進程和用戶進程。…

halcon彩色圖像顏色處理算子,持續更新

目錄apply_color_trans_lutcfa_to_rgbtrans_to_rgbclear_color_trans_lutcreate_color_trans_lutgen_principal_comp_translinear_trans_colorprincipal_comprgb1_to_grayrgb3_to_graytrans_from_rgbapply_color_trans_lut 功能&#xff1a;申請使用顏色查找表。 cfa_to_rgb …

奪命雷公狗---node.js---20之項目的構建在node+express+mongo的博客項目5mongodb在項目中實現添加數據...

我們上一步就引入了mongodb了&#xff0c;那么下一步就要開始寫添加數據了&#xff0c;不過有個前提是先將表單的數據處理好&#xff1a; 最基本的這部現在已經成功了&#xff0c;因為最基本的這步就是先將表單處的提交方式和提交地址給處理好&#xff0c;這里和PHP的基本上是一…

重新綁定ItemsSource先設置ItemsSource = null;的原因

即報錯信息為&#xff1a;在使用 ItemsSource 之前&#xff0c;項集合必須為空。原因&#xff1a;Items和ItemSource&#xff0c;只能有一個生效&#xff0c;想用其中一個&#xff0c;另一個必須是空。重新綁定ItemSource&#xff0c;雖然綁定的集合對象Clear了&#xff0c;但是…

敏捷開發學習

Scrum 敏捷開發&#xff0c;績效管理&#xff0c;團隊管理&#xff0c;企業管理&#xff0c;ASP.net MVC 敏捷開發 培訓|咨詢 工具開發 課題研討 http://blog.csdn.net/cheny_com/article/category/794542 http://blog.csdn.net/vincetest/article/category/650747 http://blog…

Git commit后,本地代碼丟失解決方法

問題描述&#xff1a; 提交代碼時&#xff0c;rebase了兩次&#xff0c;本地代碼丟失了&#xff0c;嚇得我差點跳起來。解決方法如下&#xff1a; 1、執行命令&#xff1a; git reflog d6ea731 (HEAD -> dev, origin/dev, master) HEAD{0}: checkout: moving from master to…

Edges圖像邊緣處理halcon算子,持續更新

目錄close_edgesclose_edges_lengthderivate_gaussdiff_of_gaussedges_coloredges_color_sub_pixedges_imageedges_sub_pixfrei_ampfrei_dirhighpass_imageinfo_edgeskirsch_ampkirsch_dirlaplacelaplace_of_gaussprewitt_ampprewitt_dirrobertsrobinson_amprobinson_dirsobel_…

Android存儲數據方式

可以查看Android開發文檔中的&#xff1a;/docs/guide/topics/data/data-storage.html Android provides several options for you to save persistent application data. The solution you choose depends on your specific needs, such as whether the data should be privat…

防止cpu 一直被占用 sleep(0) 和 yield

在java的Thread類中有兩個有用的函數&#xff0c;sleep和yield&#xff0c;sleep就是線程睡眠一定的時間&#xff0c;也就是交出cpu一段時間&#xff0c;yield用來暗示系統交出cpu控制權。這兩個函數在多線程開發的時候特別有用&#xff0c;可以合理的分配cpu&#xff0c;提高程…

做一個有膽識的有為青年

1、一個年輕人&#xff0c;如果在這四年的時間里&#xff0c;沒有任何想法&#xff0c;他這一生&#xff0c;就基本這個樣子&#xff0c;沒有多大改變了。 2、成功者就是膽識加魄力&#xff0c;曾經在火車上聽人談起過溫州人的成功&#xff0c;說了這么三個字&#xff0c;“膽…

jstack應用-查找CPU飚高的原因

場景 在系統上線后&#xff0c;經常會遇到運維的同學跑過來說&#xff1a;“這次發版后&#xff0c;cpu線程使用率到一場&#xff0c;到100%了”。這時候不要慌&#xff0c;可以使用堆轉儲來分析到底是哪個線程引起的。 查找元兇 [rootjava_mofei_01 test]# top Mem: 16333644…

Enhancement增強圖形halcon算子,持續更新

目錄coherence_enhancing_diffemphasizeequ_histo_imageilluminatemean_curvature_flowscale_image_max_shock_filtercoherence_enhancing_diff 功能&#xff1a;執行一個圖像的一個一致性增強擴散。 emphasize 功能&#xff1a;增強圖像對比度。 equ_histo_image 功能&am…

音頻中采樣位數,采樣率,比特率的名詞解釋(轉)

采樣位數&#xff08;采樣大小&#xff09;&#xff1a; 采樣位數可以理解為采集卡處理聲音的解析度。這個數值越大&#xff0c;解析度就越高&#xff0c;錄制和回放的聲音就越真實。我們首先要知道&#xff1a;電腦中的聲音文件是用數字0和1來表示的。所以在電腦上錄音的本質就…

WebSocket實時異步通信

WebSocket實時異步通信 【一】WebSocket簡介 WebSocket是HTML5推出一個協議規范&#xff0c;用來B/S模式中服務器端和客戶端之間進行實時異步通信。 眾所周知&#xff0c;傳統的HTTP協議中&#xff0c;服務器端和客戶端通信只能是在客戶端發送一個請求之后&#xff0c;服務器端…

多線程和多進程的區別(小結)

分類&#xff1a; linux 2009-06-19 09:33 11501人閱讀 評論(15) 收藏 舉報 很想寫點關于多進程和多線程的東西&#xff0c;我確實很愛他們。但是每每想動手寫點關于他們的東西&#xff0c;卻總是求全心理作祟&#xff0c;始終動不了手。 今天終于下了決心&#xff0c;寫點東西…

redis-cli使用密碼登錄

redis-cli使用密碼登錄 注意IP地址要寫正確&#xff01; 學習了: https://blog.csdn.net/lsm135/article/details/52932896 https://blog.csdn.net/zyz511919766/article/details/42268219 https://zhidao.baidu.com/question/756651357338691604.html 登錄后 auth pass 或者 r…