<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace TPL_Async
{
    class Async
    {
        static void Main(string[] args)
        {
            var web = new WebClient();
            var web2 = new WebClient();

            Task<string> googleTask = Task<string>.Factory.StartNew(() => { 
                return web.DownloadString("http://google.com");
            });

            googleTask.ContinueWith(t => {

                Console.WriteLine(googleTask.Result);
            });

            Task<string> yandexTask = web2.DownloadStringTaskAsync("http://yandex.ru");

            Console.WriteLine(yandexTask.Result);

            Thread.Sleep(10000);

            Console.ReadKey();
        }
    }
}<commit_msg>Added prototype with Thread run for C#<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace TPL_Async
{
    class Async
    {
        static void Main(string[] args)
        {
            Thread dedicatedThread = new Thread(ComputeBoundOp);
            dedicatedThread.Start(5);
            Console.WriteLine("Main Thread, doing other work here.");
            Thread.Sleep(1000);

            dedicatedThread.Join();

            var web = new WebClient();
            var web2 = new WebClient();

            Task<string> googleTask = Task<string>.Factory.StartNew(() => { 
                return web.DownloadString("http://google.com");
            });

            googleTask.ContinueWith(t => {
                if (t.IsFaulted)
                {
                    Console.WriteLine("Resource not found");
                }
                else
                {
                    Console.WriteLine(googleTask.Result);
                }
            });

            Task<string> yandexTask = web2.DownloadStringTaskAsync("http://yandex.ru");


            Console.WriteLine(yandexTask.Result);

            Thread.Sleep(10000);

            Console.ReadKey();
        }

        private static void ComputeBoundOp(Object state)
        {
            Console.WriteLine("In compute bound state {0}", state);
            Thread.Sleep(1000);
        }
    }
}
{'fraction_non_alphanumeric': 0.11025968497232864, 'fraction_numerical': 0.010217113665389528, 'mean_word_length': 1.7810650887573964, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5199362', 'n_tokens_mistral': 637, 'n_tokens_neox': 593, 'n_words': 123}