Back to "Aggiornamento Threading... quello che faccio in realtà..."

This is a viewer only at the moment see the article on how this works.

To update the preview hit Ctrl-Alt-R (or ⌘-Alt-R on Mac) or Enter to refresh. The Save icon lets you save the markdown file to disk

This is a preview from the server running through my markdig pipeline

Imported mostlylucidcouk

Aggiornamento Threading... quello che faccio in realtà...

Tuesday, 06 July 2004

Dovrei menzionare I supposto che ho mentito nel post di ieri su threading usando .NET...mea cupola:-). In quel post ho menzionato utilizzando delegati per multi-threading e ha detto che hai sempre dovuto utilizzare EndInvoke per evitare una perdita di memoria...beh non del tutto, quello che faccio in realtà è utilizzare l'eccellente Classe AsyncHelper di Mike Woodring, questo supporta questa sintassi:

CalcAndDisplaySumDelegate d = nuovo CalcAndDisplaySumDelegate(someCalc.Aggiungi); AsyncHelper.FireAndForget(d, 2, 3);

Nessun EndInvoke richiesto in quanto si occupa di questo utilizzando un DynamicInvoke internamente. Bene, salva alcune linee di codice!

logo

© 2026 Scott Galloway — Unlicense — All content and source code on this site is free to use, copy, modify, and sell.