The requested page is not available for the requested platform. You are viewing the content for Default platform.

Execute Statements in Parallel

Executes the selected independent statements in parallel.

Notes

  • If you use Visual Studio 2008, the Execute Statements in Parallel refactoring requires Parallel Extensions to be installed and the System.Threading namespace to be added to the project references list.
  • This refactoring is the functional opposite of Execute Statements in Serial.

Availability

Available from the context menus or via shortcuts:

  • when several statements are selected.

Example

Method1();
Method2();
Method3();
Method1()
Method2()
Method3()

Result:

Parallel.Invoke(Method1, Method2, Method3);
Parallel.Invoke(AddressOf Method1, AddressOf Method2, AddressOf Method3)

Screenshot

rsExecuteStatementsInParallelCSharp

See Also