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

Comments

sokhaty sokhaty
  • Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers

    staceyw wrote:
    Here is a CCR implementation of the Sleeping Barber(s).
    Optionally, we can add barbers (threads).
    As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the lambda.  So it is not something that has to be "baked" into a language itself as this works pretty clean as a library.

    I really like a few of ideas in this video in general:
    1) I like the ccr Port abstraction. For some reason I like endpoints and messages.
    2) I like the idea of Pre and Post conditions. This could be added to c#. Think spec# has.
    3) I like the idea explicit handling of Query and Command on shared state.  It allows tooling and static and runtime checks.
    4) I like the idea un-named types like Tuples. c# has anonymous types, but you can't pass them around.
    5) I love the idea of Transactions for object state and have them work with normal DB transactions for rollback.  That seems to be a winning pattern for handling shared state and something like CCR below for handling concurrency and coordination.

    private void button20_Click(object sender, EventArgs e)
    {
        // Have 1 Barber and N chairs. You can add Barbers (i.e. Threads in the pool) by changing the Dispatcher ctor.
        Port<string> chairsPort = new Port<string>();
        DispatcherQueue dq = new DispatcherQueue("Barber", new Dispatcher(1, "BarberPool"));
        Arbiter.Activate(dq, Arbiter.Receive(true, chairsPort, (string name) =>
            {
                Thread.Sleep(100); // Time to cut hair.
                Console.WriteLine("Customer {0} thanks the barber for the cut on thread {1}.", name, Thread.CurrentThread.ManagedThreadId);
            }));
        for (int i = 0; i < 15; i++)
            chairsPort.Post("Customer" + i);
    }

    Well, it looks to me that support for Queries and Commands would (almost) automatically require transactional support.
    No one would like to read partial state, would they?
    And in a way, it proves the point of functional programmers are trying to make - when you need to change the world, you have to create a new copy of it.
    Whoever was reading the world at the moment you decided to modify it, would continue to use the "old" consistent version of it.
    After you are done changing the world and committed your changes, all the new readers would see the new updated version. The old version will hang around long enough for all active readers conclude their activities and be "garbage collected" as soon as its no longer required.
    Which is sort of what databases already do to implement non-blocking consistent reads.
    So, it seems that eventually runtime environment will be a database with a common VM on top of it.
    But that approach has its own issues, namely a requirement to have universal change sequence number to mark world versions.

    Hmmm, is it a coincidence that Eric Meijer is said to be working on SQL Server these days?
  • John Lam and Martin Maly: Deep DLR

    Good video, really scratches the surface Smiley
    Any chance of seeing continuation of DLR discussion any time soon?

    Also, if a dynamic language chooses to implement n-ary operators, then pathological cases may become not-so-pathological at all. Not that I'm aware of any such language, but still.

    If I understand it correctly, the number of trees cached at a dynamic site is K^N (K being operators arity and N being number of types operation can be performed upon).

    Currently DLR seems to rely on equivalents of IF…THEN statements to call proper implementation of the operator depending on the type of passed in arguments.

    Wouldn't it make sense to allow dynamic language implementer (and presumably developer by proxy) to specify whether to rely on IF…THEN chains or use something like a hash table of delegates, where hash key will be produced using the list of operand types?

    And finally, if adding apples to oranges is not a supported operation in a language and while asking the language DLR will get back an exception, will DLR try to "remember" that or on the next occurrence of add(apples, oranges) it will ask for help again? Shouldn't it be also somehow configurable?

  • Joe Duffy and Igor Ostrovsky: Parallel LINQ under the hood

    Good video. Too short apparently to cover the subject deep enough Smiley
    General suggestion to the PLINQ team - please do provide programmers with extra knobs and switches to fine tune parallel execution flow. 
    Based on personal experience with SQL optimizers including the parallel ones, out of five more or less complex queries one would need a hint to run correctly.
    I wouldn't expect PLINQ be any different in this regard, especially considering that it will work on data that won't have any statistics associated with them.
  • This Week on Channel 9: March 21st episode

    Mighty cool. For extra-coolness [z-E-E-ma] should be pronounced [z-ee-m-A-A-h](which means wintEr in quite a few Slavic languages)Tongue Out
  • Christian Kleinerman: SQL Server 2008 for Developers

    Hierarchies are exciting only when you are watching a demo.
    I mean the idea of a dedicated type to store node's materialized path seems sound (though nothing prevents one from using varchar for the same purposes).
    But the implementation is weak at best.

    In fact, as soon as you try to write anything with more than a single user modifying hierarchyID columns you quickly realize that all concurrency control is your personal responsibility.

    Without proper locking of ancestry nodes hierarchyID  is a recipe for disaster. And built-in hierarchyID methods are in essence just substring equivalents.

    Ironically, there is nothing in SQL Server to manage concurrency explicitly, which in this case means ability to place explicit row locks in a non-blocking manner.

    Ideally, it should be possible to place shared read or exclusive locks on rows using T-SQL. For starter only exclusive locking would suffice (though it has some serious performance implications). But they did provide even that.

    IMO this feature should have not been included at all. People will try to use it in real life and get burned. Microsoft should have added means to ensure proper use of hierarchyID first and  produced clear guidelines on how to do that.

    Re: table types in T-SQL, compare this to complex type support in Oracle PL/SQL. T-SQL is still 10 years away from where PL/SQL was 10 years ago.
  • Inside MultiTouch: Team, Demo, Lab Tour

    Oggelito wrote:
    I wonder if the customers are ready for this technique.

    And please someone tell mr butler to cut his nails 


    Are you suggesting he should switch to nailless classic guitar playing technique?

    Long nails might provide some additional benefits like tweezers substitute.
  • Greg Leake: Stocktrader - Overview

    Nice video, too bad Greg avoided the subject of horizontal scaling of the "RDBMS" layer. As the "RDBMS" here is actually an integral and a very critical part of any more or less decent application these days, it would be nice to know how guys at Microsoft are planning to address that.
    Oracle at least claims that their RAC (real application cluster) scales horizontally.
    MS SQL Server does not even seem to have a similar concept neither in 2005, nor 2008 incarnation.

  • Peter Spiro: The power of having fun, building great databases, and leadership

    Damn, if Peter worked on record versioning/snapshot isolation in RDB at DEC, why SQL Server got this feature only in 2005 release?

    I guess it would explain why WinFS failed. Even in the planned 2008 release SQL Server still lacks a bunch of key features that are absolutely required for WinFS to function.

    Well, may be in the next 10 years or so, it would get there.

    Otherwise very interesting to watch.
  • Rick Rashid: Leading Microsoft into the Future with Research

    Hakime, you might want to edit Mach-related article on Wikipedia (http://en.wikipedia.org/wiki/Mach_kernel), so it would be consistent with your point of view. As of 5 minutes ago it read '..The lead developer on the Mach project, Richard Rashid, [ship]... Another of the original Mach developers, Avie Tevanian, ...'.

    Also, are you positive that you are not looking at the name of person who made code merge into the branch that was used to build OSX?