Multi-threading best practices

I am writing a dll that does some things asynchronously. some operations with databse, for example. Example:

(new Action(()=>
    {
    // database blablabla
    }
)).BeginInvoke((x)=>{}
              ,null);

I know about threadqueue, about background workers, about the Thread class, etc. my question is: what is the best way to do this? am i doing it right? could this cause any problems in the future?

+3
source share
2 answers

I have an article on my blog that discusses the relative merits of several approaches to asynchronous / background tasks. Asynchronous delegates are pretty low level.

, Task. , , , async CTP . , - , , API Task.

Marc . db, API Task.

0

BeginInvoke, EndInvoke. , ThreadPool ( / ()) .

, - ; - , (, , ) .

, , , .

; ; , , , , - ; - . .

+1

All Articles