Click here to Skip to main content
15,893,508 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: What do people think of UWP? Pin
Member 792148324-Apr-17 9:09
Member 792148324-Apr-17 9:09 
GeneralRe: What do people think of UWP? Pin
Nelek22-Apr-17 11:40
protectorNelek22-Apr-17 11:40 
GeneralRe: What do people think of UWP? Pin
Afzaal Ahmad Zeeshan22-Apr-17 13:22
professionalAfzaal Ahmad Zeeshan22-Apr-17 13:22 
GeneralRe: What do people think of UWP? Pin
jeffery c22-Apr-17 13:33
jeffery c22-Apr-17 13:33 
GeneralRe: What do people think of UWP? Pin
Afzaal Ahmad Zeeshan22-Apr-17 13:46
professionalAfzaal Ahmad Zeeshan22-Apr-17 13:46 
GeneralRe: What do people think of UWP? Pin
Marc Clifton22-Apr-17 13:40
mvaMarc Clifton22-Apr-17 13:40 
GeneralRe: What do people think of UWP? Pin
Afzaal Ahmad Zeeshan22-Apr-17 13:51
professionalAfzaal Ahmad Zeeshan22-Apr-17 13:51 
GeneralRe: What do people think of UWP? Pin
Jon McKee22-Apr-17 16:35
professionalJon McKee22-Apr-17 16:35 
Afzaal Ahmad Zeeshan wrote:
I think, in the next update Microsoft should work on these things, to make sure asynchrony is managed by OS itself and even being a feature of language, stays as a pain of the kernel only.

I'm not convinced this is reasonably possible. I assume when you say "asynchrony is managed by OS itself" you are saying the OS should re-use a blocking thread's time-slice? How would you maintain state then for the blocking code? If you save the stacks, registers, etc before loading the new code then you're still basically performing a context-switch with even more overhead. The OS/hardware is already both asynchronous and multi-threaded from its standpoint. The hardware has a specific number of cores ("threads") and the OS switches out kernel threads ("tasks") to make best use of them including suspending blocking kernel threads. Abstracting out these kernel threads into another thread/task pattern is of no concern to the OS and rightfully so.

The language being asynchronous would be possible but I'm not convinced it would be a benefit. Multi-threaded applications might rely on the main thread being synchronous which would no longer be a guarantee. Just enabling asynchrony by default might be an alright idea. You could just wrap the return in a Task<T> under the covers. If the function doesn't use await then it'll just run synchronously.
C#
public class Whatever
{
    public async Task<int> ReturnTwoSynchronously() => 2; //Synchronous currently, access to await if you want
    public int ReturnTwoSynchronously2() => 2; //Make the above represented by this standard pattern. As long as await is not used to create asynchronous behavior it will run synchronously.
}

At the end of the day though, is it worth the effort? My opinion - probably not.

modified 22-Apr-17 22:46pm.

GeneralRe: What do people think of UWP? Pin
Afzaal Ahmad Zeeshan23-Apr-17 1:58
professionalAfzaal Ahmad Zeeshan23-Apr-17 1:58 
GeneralRe: What do people think of UWP? Pin
Vark11124-Apr-17 3:15
Vark11124-Apr-17 3:15 
GeneralRe: What do people think of UWP? Pin
Sam Hobbs22-Apr-17 17:53
Sam Hobbs22-Apr-17 17:53 
GeneralRe: What do people think of UWP? Pin
lopatir22-Apr-17 19:35
lopatir22-Apr-17 19:35 
GeneralRe: What do people think of UWP? Pin
Sam Hobbs1-May-17 16:27
Sam Hobbs1-May-17 16:27 
GeneralRe: What do people think of UWP? Pin
BillWoodruff22-Apr-17 19:48
professionalBillWoodruff22-Apr-17 19:48 
GeneralRe: What do people think of UWP? Pin
jeffery c23-Apr-17 1:46
jeffery c23-Apr-17 1:46 
GeneralRe: What do people think of UWP? Pin
Vivi Chellappa23-Apr-17 13:01
professionalVivi Chellappa23-Apr-17 13:01 
GeneralRe: What do people think of UWP? Pin
User 1013254623-Apr-17 22:54
User 1013254623-Apr-17 22:54 
GeneralRe: What do people think of UWP? Pin
Nish Nishant24-Apr-17 2:40
sitebuilderNish Nishant24-Apr-17 2:40 
GeneralRe: What do people think of UWP? Pin
owensdj24-Apr-17 3:40
owensdj24-Apr-17 3:40 
GeneralRe: What do people think of UWP? Pin
Mike Marynowski24-Apr-17 4:02
professionalMike Marynowski24-Apr-17 4:02 
GeneralRe: What do people think of UWP? Pin
Luis M Cabrera27-Apr-17 8:58
Luis M Cabrera27-Apr-17 8:58 
GeneralWorking with professional artists... PinPopular
Mike (Prof. Chuck)21-Apr-17 20:43
professionalMike (Prof. Chuck)21-Apr-17 20:43 
GeneralRe: Working with professional artists... Pin
EveryNameIsTakenEvenThisOne22-Apr-17 0:32
professionalEveryNameIsTakenEvenThisOne22-Apr-17 0:32 
GeneralRe: Working with professional artists... Pin
Mike (Prof. Chuck)22-Apr-17 1:04
professionalMike (Prof. Chuck)22-Apr-17 1:04 
GeneralRe: Working with professional artists... Pin
OriginalGriff22-Apr-17 2:12
mveOriginalGriff22-Apr-17 2:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.