Windows线程同步(下)

时间:2022-12-27 10:07:48
  • 线程同步三:事件

CreateEvent:Creates or opens a named or unnamed event object.

HANDLE WINAPI CreateEvent(
_In_opt_ LPSECURITY_ATTRIBUTES lpEventAttributes,
_In_ BOOL bManualReset,
_In_ BOOL bInitialState,
_In_opt_ LPCTSTR lpName
);

函数说明:

第一个参数表示安全控制,一般直接传入NULL。

第二个参数确定事件是手动置位还是自动置位,传入TRUE表示手动置位,传入FALSE表示自动置位。如果为自动置位,则对该事件调用WaitForSingleObject()后会自动调用ResetEvent()使事件变成未触发状态

第三个参数表示事件的初始状态,传入TRUR表示已触发。

第四个参数表示事件的名称,传入NULL表示匿名事件。

OpenEvent:Opens an existing named event object.

HANDLE WINAPI OpenEvent(
_In_ DWORD dwDesiredAccess,
_In_ BOOL bInheritHandle,
_In_ LPCTSTR lpName
);

函数说明:

第一个参数表示访问权限,对事件一般传入EVENT_ALL_ACCESS。详细解释可以查看MSDN文档。

第二个参数表示事件句柄继承性,一般传入TRUE即可。

第三个参数表示名称,不同进程中的各线程可以通过名称来确保它们访问同一个事件。

SetEvent:Sets the specified event object to the signaled state.

BOOL WINAPI SetEvent(
_In_ HANDLE hEvent
);

函数功能:触发事件

函数说明:每次触发后,必有一个或多个处于等待状态下的线程变成可调度状态

ResetEvent:Sets the specified event object to the nonsignaled state.

BOOL WINAPI ResetEvent(
_In_ HANDLE hEvent
);

函数功能:将事件设为末触发

CloseHandle:事件销毁

举例:与Mutex中的例子相比,这里只修改了两行代码

#include <iostream>
#include <windows.h> using namespace std; long g_nNum;
#define MAX_THREADS 20
HANDLE g_hThreadEvent;
CRITICAL_SECTION g_csThreadCode; DWORD WINAPI MyThreadFunction(LPVOID lpParam)
{
int nThreadNum = *(int *)lpParam;
SetEvent(g_hThreadEvent);//释放互斥量以便供其他线程获取 Sleep();
EnterCriticalSection(&g_csThreadCode);
g_nNum++;
Sleep();
cout << "参数 " << nThreadNum << " : " << "资源:" << g_nNum << endl;
LeaveCriticalSection(&g_csThreadCode);
return ;
} int main()
{
g_hThreadEvent = CreateEvent(NULL, FALSE, TRUE, NULL);
InitializeCriticalSection(&g_csThreadCode);
HANDLE hThreadArray[MAX_THREADS];
DWORD dwThreadIdArray[MAX_THREADS] = { }; g_nNum = ;
int i = ;
while (i < MAX_THREADS)
{
WaitForSingleObject(g_hThreadEvent, INFINITE);//等待获取互斥量
hThreadArray[i] = (HANDLE)CreateThread(NULL, , MyThreadFunction, &i, , &dwThreadIdArray[i]);
i++;
}
WaitForMultipleObjects(MAX_THREADS, hThreadArray, TRUE, INFINITE); //销毁互斥量和关键段
CloseHandle(g_hThreadEvent);
DeleteCriticalSection(&g_csThreadCode);
for (i = ; i < MAX_THREADS; i++)
CloseHandle(hThreadArray[i]); system("pause");
return ;
}

模仿CRITICAL_SECTION例子中的方式,在WaitForSingleObject和SetEvent上分别下断点:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAHYCAIAAAA6TBtiAAAgAElEQVR4nOy9X2hc2Z3vK5hB9DCVaMQdPbSa8xtFUdQ+rnRs2l1Yf6ottVKIQWq1hJCsUoSoTIt4GNeIOpQRgriPRjJydUPhS8oQKIZq69y5dXwMCtdcWkbBfaoO3Itz82S4XOK8JIgc6ATyMBDoPOs+rL3WXmvvtXb92yWvkr4f6kFaWnutVX/w/vj3+9VaXe+8c1V+TExMX7t2HQ888MADDzzwwAOPph9dOsFqGGqVxeHC06j0GJ4mIqJrty85LcUhaZI3/9M7ff9XXDze/E/vtLwAAAAAAIDQsESwGgOCBQAAAACbgWABAAAAAIQMBAsAAAAAIGQgWAAAAAAAIQPBAgAAAAAIGQgWAAAAAEDIQLAAAAAAAEIGggVaoa+6G9lq3/BXek/aOn7QvF3ViZbGWNo/2l8KaT1tIJlLV47TleN0fvl1L0UwtlkqbY697lUAAEAo2CNYo0M70hajQY1GwfqvZpwrNyKnv+7iD+fOvXXQVd2QRt+InB70ERFN9Z7wzrxDX9W9vLs0ZRxTS3L2RT4m/R4rVGbXi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RWBNbMtEo2qmUXX9wsyAamSzx0CCwAAAAAu44rAktzaPBHJ3B/fiao+awUKx0Vg8bDvjI7w6+oAAADA8OGkwAqNVQu335zPbi4QxQsUjoPAknUADAtWYoGVqGwWAAAAALLHHYElyhGqtQil61Cv9zwOAouILKUoIbAAAAAA13FHYAnW9wuhZ3Dh9ptQWs1sn4+bBYuIYgJLKQEaJZtlN+baZwAAAAA4KLBkuNW9F7NaDNb5nfXwj/EUWALEYAEAAACu457AkuFW917MysB29XcIrG5chDBoAQAAAIPHEYElArD0GKxbmycyTYM0X9FYCKzCXj0McjdC3RMLrMB9CMMWAAAAMHAcEVjdMQYCKxMWd2qwYAEAAAA5AIE1mgTWK6grAAAAIBcgsAAAAAAAMgYCCwAAAAAgYyCwAAAAAAAyBgILAAAAACBjILAAAAAAADIGAisDwno1yDgFAAAAACJyR2CFRZ2PzwtKxnZa3xcbZc0cIvcEFhERPXmHrAgAAAAAICJ3BJbk1uaJUipH6CpZP4eIHBVYKAcIAAAAgBAnBdb2YyKi9f3wF6KoAjQRQWABAAAAwG3cEViiHKG0VK3vS8/grc2TwjAILPgIAQAAAEAuCSxBXFedF47PZzdfuG/BojDaHSoLAAAAGHfcE1i6NzBEjcdyVWDBggUAAACAAPcElh7PTkREC7ffnM9uLsi/nRVYiMECAAAAADkjsEQAlhqDRQu334Qb76xrrSGwAAAAAOAyjgis7oDAAgAAAIDLQGBlBUKwAAAAABACgZUBKJUDAAAAABUILAAAAACAjIHAAgAAAADIGAgsAAAAAICM+T/WZqI+dbX3HwAAAABJRU5ErkJggg==" alt="" />

然后这次再运行,与CRITICAL_SECTION中例子不同的现象发生了,这次会轮流在WaitForSingleObject和SetEvent处断下,而运行结果也显示:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAK4AAAFWCAIAAAB/2DF5AAAgAElEQVR4nO1da5dWxZU+/0ORSzdNQ9MNDSIgEHOZZNaaWZlZa+Zb/sREk3hDBJpLA3IRQUWjMYrXqDEmTsZkJV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2IMosUsVJfGtZq9V6NAtXjPmuxVaFIAJSWyMU5qt7BogtRJ+BufYnkQsQfP9RoD5CWFcl9jzjQznGDvtpBHrtgAAABiSURBVOI+4phMAjWQzUkQvZqzFEOCrDQC+wsC1BkoPhC4ng6y1ispzNPyCGAJ7LXJVqoh6H+UsxSEJS4RkcIZagoah8aJxcD4g+cOcx+dFDpcQyeFDtfQSaHDNXRS6DCL/wfGYsgyku+UxQAAAABJRU5ErkJggg==" alt="" />

参数不再有重复的了,说明利用Event实现了主线程和各个子线程间的同步

但是为什么Event可以?

Mutex有一个“所有者”的概念,只有拥有互斥对象的线程才具有访问资源 的权限,由于互斥对象只有一个,因此就决定了任何情况下此共享资源都不会同时被多个线程所访问。当前占据资源的线程在任务处理完后应将拥有的互斥对象交出,以便其他线程在获得后得以访问资源。事件对象也可以通过通知操作的方式来保持线程的同步。可以这么理解,对于Mutex,A线程占有资源S,A可以重复多次访问资源S,除非A自身决定释放,否则其它线程无法去访问S。但是对于Event就不同了。A线程Wait将事件变成未触发状态进行它的操作,操作后,B线程可以触发这个事件,继续B的后续的操作,若无线程释放,则A也无法重复的去获取这个事件以重复进行操作。

此外,Event还有一个API:PulseEvent

BOOL WINAPI PulseEvent(
_In_ HANDLE hEvent
);

函数功能:将事件触发后立即将事件设置为未触发,相当于触发一个事件脉冲。

函数说明:这是一个不常用的事件函数,此函数相当于SetEvent()后立即调用ResetEvent();此时情况可以分为两种:

1.对于手动置位事件,所有正处于等待状态下线程都变成可调度状态。

2.对于自动置位事件,所有正处于等待状态下线程只有一个变成可调度状态。

此后事件是末触发的。该函数不稳定,因为无法预知在调用PulseEvent ()时哪些线程正处于等待状态。

举例:

设为自动置位:

#include <iostream>
#include <windows.h>
using namespace std;
HANDLE g_hThreadEvent;
//快线程
DWORD WINAPI FastThreadFun(LPVOID lpParam)
{
Sleep(); //用这个来保证各线程调用等待函数的次序有一定的随机性
//cout << "启动线程" << lpParam << endl;
printf("%s 启动线程\n", lpParam);
WaitForSingleObject(g_hThreadEvent, INFINITE);//线程在等待时间
//自动就有个ResetEvent
printf("%s 等到事件被触发 顺利结束\n", lpParam);
return ;
}
//慢线程
DWORD WINAPI SlowThreadFun(LPVOID lpParam)
{
Sleep();
printf("%s 启动线程\n", lpParam);
WaitForSingleObject(g_hThreadEvent, INFINITE);
//自动就有个ResetEvent 置为未触发状态
printf("%s 等到事件被触发 顺利结束\n", lpParam);
return ;
}
int main()
{
BOOL bManualReset = FALSE;//自动置位FALSE 即自动ResetEvent(未触发状态)
//第三个参数是FALSE,标明事件被初始化时,其状态是未触发的
g_hThreadEvent = CreateEvent(NULL, bManualReset, FALSE, NULL); //"数组"的数组,其实"数组"就是地址。szFastThreadName[5][30]表示5个"数组",即5个地址.szFastThreadName[i]就是一个地址
//观察内存也可发现,这个数组szFastThreadName[5],保存了5个地址,每个地址处开辟了30字节的空间
//int a[5] = { 1, 2, 3, 4, 5 };//这里每四个字节存一个数
char szFastThreadName[][] = { "Fast1000", "Fast1001", "Fast1002", "Fast1003", "Fast1004" };//这里每30个字节存一个字符数组
//但a[i]是第一个数字,而szFastThreadName[i]不是第i个数组,而是第i个数组的地址。开辟了5*30字节空间,但是用地址代表每个数组
//我们可以想象,a是数组a[5]的首地址;那么,szSlowThreadName[1],就是数组szSlowThreadName[1][30]的首地址
char szSlowThreadName[][] = { "Slow196", "Slow197" };
DWORD dwFastThreadID[];
DWORD dwSlowThreadID[];
int i;
for (i = ; i < ; i++)
CreateThread(NULL, , FastThreadFun, szFastThreadName[i], , &dwFastThreadID[i]);
for (i = ; i < ; i++)
CreateThread(NULL, , SlowThreadFun, szSlowThreadName[i], , &dwSlowThreadID[i]); Sleep(); //保证快线程已经全部启动
cout << "现在主线程触发一个事件脉冲 - PulseEvent()" << endl;
PulseEvent(g_hThreadEvent);
//自动的话,已经有了一个ResetEvent
// SetEvent(g_hThreadEvent); //触发
// ResetEvent(g_hThreadEvent); //Sleep(3000);
cout << "时间到,主线程结束运行" << endl;
CloseHandle(g_hThread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MxFZFxyyQvyC8xC+fr0fjO4FzN7Jv3dKlKzsH34g10TuF0ZbkyZ85Cmcgjz8xrtaZoHD+4NWUjaPS+aJ37/O/HeQZOAdT6pgYjMKCccBzj5HYAjzBPQLQbjSYYJgbR2kR/QsAv+nfGV5Ih9pvZt/SevCUC0psA5wAAAB/SURBVGFUz9VedEUS2xDhAG4Z2iEIT8IfM+5PUdFTEyoU9+d/eiCEDRrBesqLPPZn7WI5lDwxkP25hkKJIfQvCEKZ4/78X0EQKovPuzdjiVSwTfQvCJXHLzpXc5//KwhCZfHJg8XIzGat7vN/BUEoQ7K//3/i9JVSJyIIQrH5f4tOBvLAKQXzAAAAAElFTkSuQmCC" alt="" />

自动置位的思路是这样的,由于CreateEvent的第三个参数是FALSE,所以,这个事件一上来是未激活的。主线程先起来7个子线程,当主线程执行一个PulseEvent时,会在某一瞬间触发一个事件,所以会有一个正在Wait的子线程被激活而顺利执行,但由于是自动置位的,所以这个被激活的子线程在WaitForSingleObject后,就立刻自动ResetEvent了,于是其它的线程无法被激活,由于主线程没有WaitForSingleObject,所以,只有主线程继续顺利执行下去。

而如果设为手动置位结果如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAU4AAAEVCAIAAAAAeJsKAAAgAElEQVR4nO19+ZeUx3X2+49YGsHMMPuwzwIIxDJYyJIla4vt2EnOSb6TL79GmyVkjFiFACG0EO2IYZl92BeBoAUasQiEQELW5tixI1uxkvwN+aGhKere+9St6re7mbfrOXP6VN+6de9Tt+5TbzPMQPLY06vyX4eP5U59eJZ+nRzz+KLLP/jw7Kkx8+vMqbEznOXMyetfp98fO/3+B4WvD82v3KnrXydOjZ04OXY8//V+/uuD997/4L3cB+/lPjiWO3Usd+rYiVNHT5w6evzk0eMn3z3+/rvH3z/y3vtHjr1/+Fju8LHc4aMnDh89cejoiYPvHj/47vGDR44fOPLegcPv7T98bP/hY/sOHd176Ojeg0f3HHx3z4F39xw4svvAkd37D4/uOzy67/DIvkMjew+N7D04vO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fMsaJqGAR4qXQ/EdGeYfEVF5tM+6s33Wndv7RydMak1Cn34BrW/N0k9l7BQLfV7n7qznpFecKPWImxpT5vxoypwf7RjYM7GhLW8x+74YdWmkDmI6owHdFgJaAzaXJG/nvWCl0+8lIqICmDb3nmlz79k5uLe2cXLeEqzbRH076HUr+QB/p5Kxg7kXHNC5qYiImwjT5907fd69O4f21TVNobNYtNSufxJiB5AdXyVsZI2/yZ++sjydm4qIuIkw4477Zsz/ya6hfXXNjNQLwH1MVYEloZR6APDVYxnxTeG8NaiFBoyIuFkwY/5PZi64f9fw/vrmqbTvla3sJd0AqXvRYOWKdejcshdbjUNERLkxc8H9HQsf6Bs+UN8yPW8JaNOCHpyadLoBDbN5gZGGwv5gjJPS3bELIyIqiZkLHuhY9GDfyIFJrYzUlY84oEx2DNTCQn8j0Kkcd7lIecE1gXlGkUfc7OhY+EBnz0P9owcb2mbkLfjJRi8C6oYjOMNq/DXBKTfn1SC9sv7O+BERNxE6Fj7Y1fNw/+jBhvaZeQtubqd0geyB0Sl1CSB4QYpgIWVLp5xilqJFRNxE6Fj0YNfih/tHDzW2d+QtuLM10mWfeDiIUiQaN997R7lW8nfeQeBWwjFL5B9Rpbj+VG+74akOHok0iN4oTeFLwev2sfgrs2gSWf4gr9MZIEo9oiRg/6xe6BulJiU3LGBnWDYOO7aMQO1WcEskzjtFc9lF1UXcjJi54P6Oheg78NZY8yhz9n1hlQRrrfPKwDw1KYAn8JeMUe0RNx2MH6GZRmeBhlkj+9BLRQlYgZWCxKHixCIibEyb92PwM/AREREZwdTb7556+907B/fWNrZXmktERETJ0D5rSfusJTsGdhd+Xz0iIiJ7+D/1FVr4aT8L5wAAAABJRU5ErkJggg==" alt="" />

因为,主线程PulseEvent之后,某个线程Wait到这个事件,而它在WaitForSingleObject并未ResetEvent,所以事件还是触发状态,其它的正在Wait的子线程仍可以Wait到,所以激活了全部子线程。

参考:http://blog.csdn.net/morewindows/article/details/7445233

  • 线程同步四:信号量(Semaphore)

CreateSemaphore

HANDLE WINAPI CreateSemaphore(
_In_opt_ LPSECURITY_ATTRIBUTES lpSemaphoreAttributes,
_In_ LONG lInitialCount,
_In_ LONG lMaximumCount,
_In_opt_ LPCTSTR lpName
);

函数功能:创建信号量

函数说明:

第一个参数表示安全控制,一般直接传入NULL。

第二个参数表示初始资源数量

第三个参数表示最大并发数量

第四个参数表示信号量的名称,传入NULL表示匿名信号量。

OpenSemaphore

HANDLE WINAPI OpenSemaphore(
_In_ DWORD dwDesiredAccess,
_In_ BOOL bInheritHandle,
_In_ LPCTSTR lpName
);

函数功能:打开信号量

函数说明:

第一个参数表示访问权限,对一般传入SEMAPHORE_ALL_ACCESS。详细解释可以查看MSDN文档。

第二个参数表示信号量句柄继承性,一般传入TRUE即可。

第三个参数表示名称,不同进程中的各线程可以通过名称来确保它们访问同一个信号量。

ReleaseSemaphore

BOOL WINAPI ReleaseSemaphore(
_In_ HANDLE hSemaphore,
_In_ LONG lReleaseCount,
_Out_opt_ LPLONG lpPreviousCount
);

函数功能:递增信号量的当前资源计数

函数说明:

第一个参数是信号量的句柄。

第二个参数表示增加个数,必须大于0且不超过最大资源数量。

第三个参数可以用来传出先前的资源计数,设为NULL表示不需要传出。

注意:当前资源数量大于0,表示信号量处于触发,等于0表示资源已经耗尽故信号量处于末触发。在对信号量调用等待函数时,等待函数(WaitForSingleObject)会检查信号量的当前资源计数,如果大于0(即信号量处于触发状态),减1后返回让调用线程继续执行。一个线程可以多次调用等待函数来减小信号量

CloseHandle

最后一个 信号量的清理与销毁.由于信号量是内核对象,因此使用CloseHandle()就可以完成清理与销毁了。

在经典多线程问题中设置一个信号量和一个关键段。用信号量处理主线程与子线程的同步,用关键段来处理各子线程间的互斥。举例:

#include <stdio.h>
#include <windows.h>
long g_nNum;
const int THREAD_NUM = ;
//信号量与关键段
HANDLE g_hThreadParameter;
CRITICAL_SECTION g_csThreadCode; DWORD WINAPI ChildThread(LPVOID lpParam)
{
int nThreadNum = *(int *)lpParam;
ReleaseSemaphore(g_hThreadParameter, , NULL);//信号量++ 变为1,主线程中的WaitForSingleObject
//才能Wait到信号量,从而继续的执行 Sleep(); EnterCriticalSection(&g_csThreadCode);
++g_nNum;
Sleep();
printf("线程:%d 资源:%d\n", nThreadNum, g_nNum);
LeaveCriticalSection(&g_csThreadCode);
return ;
} int main()
{
//初始化信号量和关键段
g_hThreadParameter = CreateSemaphore(NULL, , , NULL);//初始0个资源,最大允许1个同时访问
InitializeCriticalSection(&g_csThreadCode); HANDLE handle[THREAD_NUM];
g_nNum = ;
int i = ;
while (i < THREAD_NUM)
{
handle[i] = (HANDLE)CreateThread(NULL, , ChildThread, &i, , NULL);
WaitForSingleObject(g_hThreadParameter, INFINITE);//等待信号量>0
++i;
}
WaitForMultipleObjects(THREAD_NUM, handle, TRUE, INFINITE); DeleteCriticalSection(&g_csThreadCode);
CloseHandle(g_hThreadParameter);
for (i = ; i < THREAD_NUM; i++)
CloseHandle(handle[i]); system("pause");
return ;
}

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKgAAAC+CAIAAAAuptNlAAAayklEQVR4nO1d+VsUV9au/yMiKPsOCoIg4hI1xmyjZtHoZLK4G1AWlR2apWnoBtlRUQTcUeIW4wLYKPuOislMZr7ZkoyZzB/x/VDaKe6959Ttorqruu33uY9P9alT977nvOfcSyggQkXdmYq606a6FlNti7HmlLHmVHltS3lti6m2xVR32lR32lTfWlHfWtlwtrLxbGVjm7mxzdLUYWlqtzS1W5raLE3tlqaz5sY2c2OrubHV0tRmaWqram6vbmqzNLZZGlvNDWcq606VH28uszQYKmoLy6sLjdUFZZb8UnN+iTm/VByV0pFXUiGO3OKKXENFjsGUXVSeXVielV92NL8kM9eQnl2QlpWfdjT/8JHc1Myc1IzslPTsr9OzDqYdO5h27EDa0QOHj+4/fGTfocx9qZl7UzP2pGTs/jp9d0rm7pSMXSkZu77O2PV15ldfZ3x5MOOLg+mf70/7bF/aZ/vS/rjv8M79h3fuP7TjQOqnKYd3ZGZ8mpO5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XAAAAAElFTkSuQmCC" alt="" />

CreateSemaphore的第二个参数位0,第三个参数为1,表示信号量初始为0,最多允许1个线程同时访问。主线程中CreateThread之后,信号量个数为0,所以主线程只能一直Wait,直到子线程中有一个ReleaseSemaphore是的信号量个数加1大于0,
这时主线程才能Wait到信号量,且自动减1。而后边主线程如果再想执行,也必须要等到其它子线程先ReleaseSemaphore才行。

可以看出来,信号量也可以解决线程之间的同步问题。

参考:http://blog.csdn.net/morewindows/article/details/7481609

Windows线程同步(下)的更多相关文章

  1. windows线程同步

    一.前言 之前在项目中,由于需要使用到多线程,多线程能够提高执行的效率,同时也带来线程同步的问题,故特此总结如下. 二.windows线程同步机制 windows线程同步机制常用的有几种:Event. ...

  2. Windows线程同步(上)

    先介绍一个创建线程的API,参考:https://msdn.microsoft.com/en-us/library/windows/desktop/ms682453%28v=vs.85%29.aspx ...

  3. windows线程同步的总结

    一 线程 1)如果你正在编写C/C++代码,决不应该调用CreateThread.相反,应该使用VisualC++运行期库函数_beginthreadex,退出也应该使用_endthreadex.如果 ...

  4. 关于windows线程同步的四种方法

    #include "stdafx.h" #include "iostream" #include "list" #include &quot ...

  5. windows线程同步的几种方式

    以下为main函数的测试代码 具体线程同步的实现代码请下载:https://github.com/kingsunc/ThreadSynchro #include <stdio.h> #in ...

  6. windows 线程同步

    Windows 临界区,内核事件,互斥量,信号量. 临界区,内核事件,互斥量,信号量,都能完成线程的同步,在这里把他们各自的函数调用,结构定义,以及适用情况做一个总结. 临界区: 适用范围:它只能同步 ...

  7. 总结windows多线程同步互斥

    windows多线程同步互斥--总结 我的windows多线程系列文章: windows多线程--原子操作 windows多线程同步--事件 windows多线程同步--互斥量 windows多线程同 ...

  8. Windows线程&plus;进程通信

    一 Windows线程进程 1)定义 按照MS的定义, Windows中的进程简单地说就是一个内存中的可执行程序, 提供程序运行的各种资源. 进程拥有虚拟的地址空间, 可执行代码, 数据, 对象句柄集 ...

  9. 关于Java多线程的线程同步和线程通信的一些小问题(顺便分享几篇高质量的博文)

    Java多线程的线程同步和线程通信的一些小问题(顺便分享几篇质量高的博文) 前言:在学习多线程时,遇到了一些问题,这里我将这些问题都分享出来,同时也分享了几篇其他博客主的博客,并且将我个人的理解也分享 ...

随机推荐

  1. linux c 笔记-4 工程项目阅读推荐

    作者:周子涵链接:https://www.zhihu.com/question/27705862/answer/37738315来源:知乎著作权归作者所有,转载请联系作者获得授权. 转自网上不知道什么 ...

  2. POJ 3020 Antenna Placement

    Antenna Placement Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5645 Accepted: 2825 Des ...

  3. Android(java)学习笔记65:线程的生命周期

    1. 我们学习线程本质就是学习如何开始线程和终止线程.下面这个关于线程的生命周期图,要牢记: 新建状态:当程序使用new关键字创建了一个线程之后,该线程就处于新建状态.此时和其他Java对象一样,它仅 ...

  4. 从&lbrack;NOI2008志愿者招募&rsqb;浅谈线性规划在网络流构图上的巧用

    首先来看一下题..http://www.lydsy.com/JudgeOnline/problem.php?id=1061 1061: [Noi2008]志愿者招募 Description 申奥成功后 ...

  5. Gulp livereload

    平时使用yeoman作为前端部署工具,感觉到yeoman构建工具虽然方便,但是速度和大小总是不尽人意. 最近看到了gulp http://gulpjs.com/ 比较感兴趣随动手一试 gulp的安装以 ...

  6. localStorage溢出问题

    项目使用的store.js库 store.js库不能管理localStorage中的过期项到时清除,只能在再次调用get的时候才做处理,如果一直不调用get,过期了也还是占用着空间.溢出后,再储存项目 ...

  7. Android中弹出dialog后无法捕捉back键

    一.需求 在Android开发过程中,弹出dialog后无法捕捉back键,点击back按键无响应. 二.解决方案 原因:弹出dialog后,activity失去焦点,dialog获得当前焦点. 解决 ...

  8. jQuery-2&period;DOM---节点插入

    DOM内部插入append()与appendTo() 动态创建的元素是不够的,它只是临时存放在内存中,最终我们需要放到页面文档并呈现出来.那么问题来了,怎么放到文档上? 这里就涉及到一个位置关系,常见 ...

  9. sql字符处理

    --Description: 字符处理 --使用: 放到查询分析器里执行就可以了 --示例: select * from dbo.splitstr('12 44 45 50 56 87',' ') o ...

  10. springboot项目的重定向和转发

    下面是idea软件创建的项目目录,这里总结了一下转发与重定向的问题,详解如下. 首先解释一下每个文件夹的作用,如果你是用的是idea创建的springboot项目,会在项目创建的一开始resource ...