CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of Parallel
C#
// compile in release mode
bool stop = false;
bool toggle = false;
ThreadPool.QueueUserWorkItem(delegate
{
    while (!stop)
    {
        toggle = !toggle;
        //Thread.MemoryBarrier();
    }
by bnaya   January 04, 2012 @ 6:59am
40 Views
no comments
 
C#
class Program
{
    static void Main(string[] args)
    {
        bool isComplete = false;
        var t = Task.Factory.StartNew(() =>
        {
            bool toggle = false;
            while (!isComplete) // read the cached value
            {
by bnaya   December 14, 2011 @ 1:49am
Tags: Tpl, Parallel
44 Views
no comments
 
C#
using System.Security;
using System.Threading.Tasks;
using System.Threading;
 
namespace Tpl.Samples
{
    class Program
    {
        [DllImport("Kernel32.dll"), SuppressUnmanagedCodeSecurity]
        public static extern int GetCurrentProcessorNumber();
by bnaya   January 28, 2011 @ 3:45am
Tags: Parallel
333 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate