Entries:
Comments:
Posts:

Loading User Information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading User Information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

Artur Mustafin

Artur Mustafin hack2rootho​tmai
  • Concurrency and Coordination Runtime

    Hi everyone! You are welcome to try my commit to the community and play with my framework samples at http://plugins.codeplex.com/">http://plugins.codeplex.com

     

    Sincerely yours,
    hack2root

  • CCR Programming - Jeffrey Richter and George Chrysanthakopoulos

    Everyone are welcome to try my commit to the community and play with my framework samples at http://plugins.codeplex.com

     

    Sincerely yours,
    hack2root

  • Robotics Developer Studio 2008 R2 Available

    I'm able to buld functionality similar to Decentralized Software Services (DSS), CCR is close to me, alone (in the dark).

    See my project at http://plugins.codeplex.com

     

  • Patterns and Match Expressions in F#

    Ok, I'm a great fun of F# as well as IronPython. Besides what he is talking about, i feel his coolness and geeky just because he speaks about F#! Great topic! So cool that he uses glasses!

  • Task Parallel Library: Task Results

    Suppose it is a naive implementation of sequential access pattern. I'm even thiniking should or shoudnt I create the analogue sample for the my library at http://plugins.codeplex.com? Because I already have working sequential pattern (in conjunction of lasy evaluation pattern) in use of logging mechanism, when a lot of logging operations each of them is not VERY time consuming, can resonably slow down OVERALL application preformance. See my SequentialWorkItem<T> implementation in Plugins.Threading library.

  • Task Parallel Library: Task Results

    Нихрена не понял, но прикольно!!!

    Actually I can understand German. Author shows us the way we can use new Threading extensions and Result property in particual in some syntetic sample. Do you really gonna draw a graph of relation (sync-ing) for more than 1 different compenting threads types? Do it actually works for you? I mean there is a better way to spen our time anyway Wink If guys from Microsoft even forgot this field it is trivial to implement it manually. Anyway, good news that they didn't forget all great Result property.

  • Mickey Mouse pattern by Ward Bell : At the p&p summit

    LOL!

  • Sebastian Burckhardt - Data Race Detection with CHESS

    I spent a couple of time to build a good, working solution for .NET 2.0 / 3.5, so you do not need to wait and install .NET 4.0

    Can you test it using CHESS?

    Abstract:

        public abstract class PluginBaseWorkItem<T>

        {

            private static object _sync = new object();

            private T _item;

            public T Item { get { return _item; } }

            public void Run()

            {

                List<WaitHandle> _waitHandles = new List<WaitHandle>();

                for (int i = 0; i < TaskCount; i++)

                {

                    _waitHandles.Add(new AutoResetEvent(false));

                }

                for (int i = 0; i < TaskCount; i++)

                {

                    ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessHandle), _waitHandles[i]);

                }

                WaitHandle.WaitAll(_waitHandles.ToArray());

            }

            protected abstract void ProcessItem();

            protected void SetValue(T item)

            {

                _item = item;

            }

            protected T GetValue()

            {

                return _item;

            }

            protected virtual int TaskCount { get { return Environment.ProcessorCount; } }

            private void Process()

            {

                ProcessItem();

            }

            private void ProcessHandle(object sync)

            {

                AutoResetEvent waitHandle = (AutoResetEvent)sync;

                Process();

                waitHandle.Set();

            }

        }

     

             private class WorkItem : PluginBaseWorkItem<Puzzle>

            {

                protected override void ProcessItem()

                {

                    DlxEngine engine = new DlxEngine();

                    Puzzle value = engine.Generate(20);

                    lock (this)

                    {

                        Puzzle item = GetValue();

                        if (item == null || value.Rating > item.Rating)

                        {

                            SetValue(value);

                        }

                    }

                }

            }

     

            public static IPuzzle Create()

            {

                WorkItem workItem = new WorkItem();

                workItem.Run();

                IPuzzle puzzle = workItem.Item;

                return Create(puzzle.Text, puzzle.Seed);

            }

  • Erika Parsons and Eric Eilebrecht : CLR 4 - Inside the Thread Pool

    I spent a couple of time to build a good, working solution for .NET 2.0 / 3.5, so you do not need to wait and install .NET 4.0

    Abstract:

        public abstract class PluginBaseWorkItem<T>

        {

            private static object _sync = new object();

            private T _item;

            public T Item { get { return _item; } }

            public void Run()

            {

                List<WaitHandle> _waitHandles = new List<WaitHandle>();

                for (int i = 0; i < TaskCount; i++)

                {

                    _waitHandles.Add(new AutoResetEvent(false));

                }

                for (int i = 0; i < TaskCount; i++)

                {

                    ThreadPool.QueueUserWorkItem(new WaitCallback(ProcessHandle), _waitHandles[i]);

                }

                WaitHandle.WaitAll(_waitHandles.ToArray());

            }

            protected abstract void ProcessItem();

            protected void SetValue(T item)

            {

                _item = item;

            }

            protected T GetValue()

            {

                return _item;

            }

            protected virtual int TaskCount { get { return Environment.ProcessorCount; } }

            private void Process()

            {

                ProcessItem();

            }

            private void ProcessHandle(object sync)

            {

                AutoResetEvent waitHandle = (AutoResetEvent)sync;

                Process();

                waitHandle.Set();

            }

        }

     

             private class WorkItem : PluginBaseWorkItem<Puzzle>

            {

                protected override void ProcessItem()

                {

                    DlxEngine engine = new DlxEngine();

                    Puzzle value = engine.Generate(20);

                    lock (this)

                    {

                        Puzzle item = GetValue();

                        if (item == null || value.Rating > item.Rating)

                        {

                            SetValue(value);

                        }

                    }

                }

            }

     

            public static IPuzzle Create()

            {

                WorkItem workItem = new WorkItem();

                workItem.Run();

                IPuzzle puzzle = workItem.Item;

                return Create(puzzle.Text, puzzle.Seed);

            }

  • Erika Parsons and Eric Eilebrecht : CLR 4 - Inside the Thread Pool

    I think I can hep peuple with my private solution; think of it, my framework uses only several BCL classes, allow us delivers the full power of mult-core multi-threading apps directly from .NET 3.5

    I used only these BCL classes: AutoResetEvent, Monitor, ThreadPool and WaitHandle. Framework is designed for both parallelisms: vertical parallalism (number of concurrent items per processor) and horisontal parallelism (number of  processors consumed).

    It is so simple, that programmer must care about olny about how implement parallelism on a given algorithm using parallel work items. A programmer needs to implement single work item for the algorithm itself and generic type of data used in this work item.

    By default, the queue engine tries to scale algorithm horisontally, processing work items to fit the number of virtual cores (Environment.ProcessorCount) in a one single thread, then if it is succeded (so overall number of estimate parallel work item tasks is greater ot equal to the required number of processors), it scales vertivally, in a way, when th code with the least number of tasks gets the most of the priority in allocation nex work item, so all cores are used virtually equally, depending to the algorithm. But nothing stops to cutomize the algorithm to run 85% of ("cheap") of parallel work items on a single core, wile other, 15% ("hard") of work items (for example if you have a 8 core i7), on all other processor cores, and, beleive me, it is very easy.

    It is about a couple of kilobytes long and several lines oof code, extremely easy to read and understand. I used PEX, CodeContracts. So it really makes me happy for it! And it just works!

    If somebody want to get it, please leave requests here. Probably I will add it to my library http://plugins.codeplex.com

    That's all, folks!