9eFish - 带有 Multithreading 标签的文章
1
臭虫

Multithreading: when interlocked operations aren’t enough - LA.NET [EN]

dotlivedotlive 发表于 250 天, 7 小时, 46 分钟 之前
Friday, July 03, 2009 8:16:31 AM GMT Friday, July 03, 2009 1:53:45 AM GMT
Multithreading: when interlocked operations aren’t enoughPublished Thu, Jul 2 2009 15:45 In the previous post, we’ve started looking at interlocked operations. As we’ve seen, interlocked operations are great at what they do but they won’t be usable in all scenarios (ie, don’t think that they’ll solve all your locks problems). To show how things might go awry when using interlocks, I’ll reuse a great example written by Raymond Chen a few years ago (I’m updating it to C... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: introducing the interlocked operations - LA.NET [EN]

dotlivedotlive 发表于 250 天, 7 小时, 47 分钟 之前
Friday, July 03, 2009 8:16:31 AM GMT Friday, July 03, 2009 1:53:07 AM GMT
Multithreading: introducing the interlocked operationsPublished Thu, Jul 2 2009 12:58 As we’ve seen in the previous post, most processors give us important insurances regarding memory loads and stores. However, even though those insurances are important and can be used in several scenarios, the truth is that they aren’t enough for all real world tasks. Fortunately, most processors also offer a group of interlocked operations which enable atomic compare and swap scena... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: hardware atomicity - LA.NET [EN]

carolhaozicarolhaozi 发表于 253 天, 7 小时, 37 分钟 之前
Friday, July 03, 2009 8:16:31 AM GMT Tuesday, June 30, 2009 2:02:45 AM GMT
Multithreading: hardware atomicityPublished Mon, Jun 29 2009 22:41 In the previous post, we’ve started looking at memory loads and stores reordering. In this post, we’re going to keep our study and we’re going to introduce atomicity. Atomicity is a really important concept we’ve met in the past. We’ve already talked about it on a higher level: do you recall our discussion on critical regions (and how they’re implemented through critical sections)? With critical regi... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: load and store reordering - LA.NET [EN]

carolhaozicarolhaozi 发表于 253 天, 7 小时, 37 分钟 之前
Friday, July 03, 2009 8:16:31 AM GMT Tuesday, June 30, 2009 2:02:18 AM GMT
Multithreading: load and store reorderingPublished Mon, Jun 29 2009 10:55 Until now, we’ve been busy talking a look at several interesting topics associated with multithreading programming. As we’ve seen, one of the most problematic areas in multithreaded programs is sharing state across multiple threads. As we’ve seen in several posts along this series, we can use a critical regions for ensuring that shared state is accessed by one thread at a time. In other words, u... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: the BackgroundWorker class - LA.NET [EN]

xgluxvxgluxv 发表于 257 天, 7 小时, 6 分钟 之前
Friday, July 03, 2009 8:16:31 AM GMT Friday, June 26, 2009 2:33:37 AM GMT
Multithreading: the BackgroundWorker classPublished Thu, Jun 25 2009 11:27 In the last posts of the series, we’ve been looking at many important features related to GUIs and multithreading. Today, we’re going to wrap up this topic with the BackgroundWorker class. The previous posts are really targeted at library developers. The truth is that having to implement the EAP pattern  to have asynchronous behavior is simply too much work. Interact with the SynchronizationC... (more)
类别: Foundation | 点击: 1 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: AsyncOperationManager and AsyncOperation helpers

adminadmin 发表于 258 天, 7 小时, 2 分钟 之前
Thursday, July 02, 2009 2:18:29 AM GMT Thursday, June 25, 2009 2:37:55 AM GMT
In the last posts, we’ve taken a look at how synchronization contexts help marshal work across threads. Today we’re going to talk about two classes (which we’ve already met in the past when we implemented the EAP) that abstract even further the use of synchronization contexts: I’m talking about the AsyncOperationManager and AsyncOperation classes. Let’s start with the AsyncOperationManager class. (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: Introducing synchronization contexts - LA.NET [EN]

dotlivedotlive 发表于 259 天, 8 小时, 6 分钟 之前
Tuesday, June 30, 2009 2:05:59 AM GMT Wednesday, June 24, 2009 1:33:24 AM GMT
Multithreading: Introducing synchronization contextsPublished Tue, Jun 23 2009 11:08 In the last post, we’ve seen how to marshal back the results obtained on a secondary thread so that controls are updated on the GUI thread. Today we’re going to start looking at synchronization contexts. Synchronization contexts are abstractions for marshalling between threads. In other words, they abstract those scenarios where you cannot call a method from the current thread and nee... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: windows forms and synchronization contexts - LA.NET [EN]

dotlivedotlive 发表于 259 天, 8 小时, 7 分钟 之前
Tuesday, June 30, 2009 2:05:59 AM GMT Wednesday, June 24, 2009 1:32:55 AM GMT
Multithreading: windows forms and synchronization contextsPublished Tue, Jun 23 2009 12:14 In the previous post, we’ve started looking at synchronization contexts. In this post, we’ll take a close look at the widows forms custom synchronization context. Whenever you run a windows form app, you might end up interacting with the WindowsFormsSynchronizationContext. The constructor of this class is responsible for getting a reference to the GUI thread so that it can then ... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: the ISynchronizeInvoke interface - LA.NET [EN]

adminadmin 发表于 260 天, 7 小时, 7 分钟 之前
Friday, June 26, 2009 2:37:00 AM GMT Tuesday, June 23, 2009 2:32:24 AM GMT
Multithreading: the ISynchronizeInvoke interfacePublished Mon, Jun 22 2009 20:26 In the last post, we’ve see that multithreading is almost a necessity in GUIs. We’ve also seen that there are some gotchas associated with it: a control can only be updated from the GUI thread. In practice, this means that we’ll need to marshal back the results to the main thread when they’re ready. In .NET, the Windows Forms introduces the ISynchronizeInvoke interface for performing tha... (more)
类别: Foundation | 点击: 2 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: adding cancelation to the initial event based pattern implementation - LA.NET [EN]

adminadmin 发表于 264 天, 7 小时, 33 分钟 之前
Wednesday, June 24, 2009 1:39:58 AM GMT Friday, June 19, 2009 2:06:45 AM GMT
Multithreading: adding cancelation to the initial event based pattern implementationPublished Thu, Jun 18 2009 22:45 Today we’re going to improve the code we’ve started writing yesterday: we’re adding canceling support. As you might recall, in our last post we’ve built a simple class which supports a single asynchronous operation at a time. Since we only support one asynchronous operation at a time and we can only start one asynchronous operation from our class, then ... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: implementing the event based pattern - LA.NET [EN]

adminadmin 发表于 265 天, 7 小时, 15 分钟 之前
Wednesday, June 24, 2009 1:39:58 AM GMT Thursday, June 18, 2009 2:24:51 AM GMT
Multithreading: implementing the event based patternPublished Wed, Jun 17 2009 22:38 In the last post of the series, we’ve taken a look at the main features offered by the event based pattern. Today, we’re going to look at how we can implement that pattern. We’re going to start small and we’re going to reuse the IAsyncResult sample for showing how you can implement this pattern. As we’ve seen in the previous post, we need to (at least) add a method (named XXXAsync) t... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: introducing the event based asynchronous pattern - LA.NET [EN]

adminadmin 发表于 266 天, 19 小时, 57 分钟 之前
Tuesday, June 23, 2009 2:38:02 AM GMT Tuesday, June 16, 2009 1:42:59 PM GMT
Multithreading: introducing the event based asynchronous patternPublished Tue, Jun 16 2009 10:06 In the last posts we’ve looked at several details associated with the use of the APM pattern. Today we’re going to start looking at the second pattern for doing asynchronous work: the event based asynchronous pattern. This pattern was introduced with .NET 2.0 and it targets components that are going to be used in GUIs. In other words, if you’re building components that ar... (more)
类别: Foundation | 点击: 2 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: implementing the IAsyncResult interface - LA.NET [EN]

adminadmin 发表于 267 天, 18 小时, 29 分钟 之前
Saturday, June 20, 2009 7:09:14 AM GMT Monday, June 15, 2009 3:11:15 PM GMT
Multithreading: implementing the IAsyncResult interfacePublished Mon, Jun 15 2009 11:47 Today we’re going to wrap up our study of the APM pattern by seeing how we can implement the IAsyncResult interface. For those that can’t remember, here’s the interface API again: public interface IAsyncResult{     object AsyncState { get; }     WaitHandle AsyncWaitHandle { get; }     bool CompletedSynchronously { get; }     bool IsCompleted { get; } } As ... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: understanding the BeginXXX and EndXXX methods - LA.NET [EN]

dotlivedotlive 发表于 268 天, 7 小时, 42 分钟 之前
Friday, June 19, 2009 1:22:01 PM GMT Monday, June 15, 2009 1:58:10 AM GMT
Multithreading: understanding the BeginXXX and EndXXX methodsPublished Sun, Jun 14 2009 21:42 Now that we’ve looked at the available waiting options for the APM pattern, it’s time to start digging on its internals. This post is all about understanding the work of the BeginXXX and EndXXX methods (which isn’t much, as we’ll see). As we’ve seen in previous posts, the BeginXXX method is responsible for kicking off the asynchronous processing. In theory, you’d expect it t... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: the APM pattern and polling for completion - LA.NET [EN]

dotlivedotlive 发表于 272 天, 6 小时, 53 分钟 之前
Saturday, June 13, 2009 12:13:43 PM GMT Thursday, June 11, 2009 2:46:35 AM GMT
Multithreading: the APM pattern and polling for completionPublished Wed, Jun 10 2009 12:09 In this post we’re going to take a look at how we can use polling to see if an asynchronous task has completed. As we’ve seen, the IAsyncResult instance returned from the BeginXXX method (that started an asynchronous task) has an IsCompleted property that returns true when the task is completed. In practice, this means that you can use this property for polling the status of th... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: APM and the continuation passing style - LA.NET [EN]

dotlivedotlive 发表于 272 天, 6 小时, 57 分钟 之前
Saturday, June 13, 2009 12:13:43 PM GMT Thursday, June 11, 2009 2:43:07 AM GMT
Multithreading: APM and the continuation passing stylePublished Wed, Jun 10 2009 13:35 In this post, we’ll take a look at the last option we can use for the rendezvous phase of the APM pattern. This last option is based on the continuation passing style principle. In practice, this means that we need to wrap up the work that should be performed after the async task ends in a closure and pass it to the BeginXXX method. There are some cases where this might not be a vi... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: waiting on the APM’s WaitHandle - LA.NET [EN]

carolhaozicarolhaozi 发表于 273 天, 6 小时, 12 分钟 之前
Saturday, June 13, 2009 12:13:43 PM GMT Wednesday, June 10, 2009 3:28:08 AM GMT
Multithreading: waiting on the APM’s WaitHandlePublished Tue, Jun 9 2009 22:25 Today, we’re going to keep looking at the available options waiting for the conclusion of an asynchronous task started through the APM model. In this post we’re going to see how we can use the WaitHandle which we can get through the IAsyncResult’s AsyncWaitHandle property. After getting a valid reference to it, you can do what you normally do with handles: make the thread wait until it get... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: blocking the thread by calling EndXXX directly - LA.NET [EN]

carolhaozicarolhaozi 发表于 273 天, 7 小时, 36 分钟 之前
Thursday, June 11, 2009 7:13:03 AM GMT Wednesday, June 10, 2009 2:03:37 AM GMT
Multithreading: blocking the thread by calling EndXXX directlyPublished Tue, Jun 9 2009 10:07 As we’ve seen, one of the available options is blocking the thread by calling the EndXXX method directly. This might be a good option when you only need to do one or two small tasks and then you need to wait until the asynchronous operation is completed. In practical terms, this option won’t be usable in many scenarios. However, I’d say that this is the easiest of the four a... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: the IAsyncResult interface - LA.NET [EN]

adminadmin 发表于 274 天, 19 小时, 19 分钟 之前
Tuesday, June 09, 2009 12:54:22 PM GMT Monday, June 08, 2009 2:20:42 PM GMT
Multithreading: the IAsyncResult interfacePublished Mon, Jun 8 2009 8:54 In the last post, we’ve started looking at the APM model used by the .NET framework. Today we’re going to talk about the role played by the IAsyncResult interface. Currently, the IAsyncResult interface has the following members: public interface IAsyncResult {     object AsyncState { get; }     WaitHandle AsyncWaitHandle { get; }     bool CompletedSynchronously { get; }     bo... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
1
臭虫

Multithreading: APM and options for waiting until work completes - LA.NET [EN]

adminadmin 发表于 274 天, 19 小时, 19 分钟 之前
Thursday, June 11, 2009 7:13:03 AM GMT Monday, June 08, 2009 2:20:17 PM GMT
Multithreading: APM and options for waiting until work completesPublished Mon, Jun 8 2009 9:50 In the last post, we’ve started looking at oldest asynchronous pattern of the .NET framework: the APM model. Today, we’re going to list the available options for waiting to the completion of an asynchronous operation started through a framework that implements APM pattern. After kicking off an asynchronous operation, we have four available options:we can block the thread un... (more)
类别: Foundation | 点击: 0 | 评论 | | 源: msmvps.com
标签: Multithreading
Previous 1 2 3 Next