Click here to Skip to main content
15,918,109 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: Windoze versus Linux - NOT MS bashing post. Pin
Camilo Reyes26-Jul-15 9:10
professionalCamilo Reyes26-Jul-15 9:10 
QuestionRe: Windoze versus Linux - NOT MS bashing post. Pin
enhzflep26-Jul-15 17:07
enhzflep26-Jul-15 17:07 
AnswerRe: Windoze versus Linux - NOT MS bashing post. Pin
Camilo Reyes27-Jul-15 3:30
professionalCamilo Reyes27-Jul-15 3:30 
QuestionRe: Windoze versus Linux - NOT MS bashing post. Pin
enhzflep27-Jul-15 17:55
enhzflep27-Jul-15 17:55 
GeneralRe: Windoze versus Linux - NOT MS bashing post. PinPopular
Marc Clifton26-Jul-15 9:18
mvaMarc Clifton26-Jul-15 9:18 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
PIEBALDconsult26-Jul-15 13:36
mvePIEBALDconsult26-Jul-15 13:36 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
Munchies_Matt26-Jul-15 23:24
Munchies_Matt26-Jul-15 23:24 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
irneb27-Jul-15 0:01
irneb27-Jul-15 0:01 
OK, some of the other answers are the typical: "Let me try and sell you on my favourite" ... but that's not what you asked for is it? Well, let's look at the exact scenario you're referring to: Event loops (at least as I understand it the interactive message loops like in a GUI). In both Win&Lin the basic idea is similar (for that matter pretty much the same thing in UNIX and OSX too), the program/process awaits some message sent from the kernel to indicate that something happened. Both (and basically all mainstream) OSs are event driven in that they read "events" from some IO process and then pass them on to whatever processes are waiting for them.

It's just in the details where this differs. E.g. in Windows the process must call the GetMessage function, which simply blocks until a message has been received, at which time it sends that to the process and the process continues with its internal loop. In Linux you'd most basically attach in a similar manner to any one of the XWindows Library's XNextEvent set of functions (depending on exactly what type of "event" you're expecting).

Though note, mostly (at least these days) you'd not go into that sort of detail. E.g. some of the GUI frameworks would abstract away this "looping and waiting" idea by you simply attaching any of your process' functions to an event opened by that framework/toolkit. It would then (behind the scenes) perform the message loop and call your function if the event it is attached to compares to the current message. This pretty much happens in all newer GUI frameworks, both Windows (e.g. with DotNet's WinForms/WPF) as well as Linux (e.g. GTK).

Actually this is one of the notable exceptions from the usual idea of Unix (and derivatives): Everything is a "file" and can be accessed as if you're reading/writing a file. E.g. do some searching about POSIX's select and pselect calls (or perhaps reading per byte from select and then writing that into a pipe which is then read by another thread in your program as a file). At least if you're going to go into the very kernel-level message handling, usually though you'd not need to go that far for basic server/desktop programs. BTW, if you use GTK+ as your GUI toolkit you're basically just opening a "file" to show that your program is interested in "that event" - thus your loop reads the file for any new data (basically same principle as Windows' GetMessage call).

Well, that's a very long discussion on something rather trivial, not to mention usually not even necessary to think about (at least not when using some toolkits). I'd highly recommend you do some serious web searching / research on the exact things you're interested in. You could probably do an honours degree on just the basic differences between Win and Lin (especially if comparing such in this level of nuance).

GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
Vaclav_27-Jul-15 6:15
Vaclav_27-Jul-15 6:15 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
irneb27-Jul-15 6:57
irneb27-Jul-15 6:57 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
Gary Wheeler27-Jul-15 1:02
Gary Wheeler27-Jul-15 1:02 
GeneralRe: Windoze versus Linux - NOT MS bashing post. Pin
Ygnaiih27-Jul-15 2:01
professionalYgnaiih27-Jul-15 2:01 
Generalwhen the client thinks you can do it cheaper with open-source ... Pin
BillWoodruff26-Jul-15 2:02
professionalBillWoodruff26-Jul-15 2:02 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
Daniel Pfeffer26-Jul-15 8:16
professionalDaniel Pfeffer26-Jul-15 8:16 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
Gary Wheeler27-Jul-15 1:06
Gary Wheeler27-Jul-15 1:06 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
BillWoodruff27-Jul-15 8:30
professionalBillWoodruff27-Jul-15 8:30 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
Gary Wheeler27-Jul-15 8:32
Gary Wheeler27-Jul-15 8:32 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
BillWoodruff27-Jul-15 20:50
professionalBillWoodruff27-Jul-15 20:50 
GeneralRe: when the client thinks you can do it cheaper with open-source ... Pin
Gary Wheeler28-Jul-15 1:56
Gary Wheeler28-Jul-15 1:56 
GeneralCalamari anyone? Pin
Richard Andrew x6425-Jul-15 19:04
professionalRichard Andrew x6425-Jul-15 19:04 
GeneralRe: Calamari anyone? Pin
Marc Clifton26-Jul-15 9:20
mvaMarc Clifton26-Jul-15 9:20 
GeneralRe: Calamari anyone? Pin
Munchies_Matt26-Jul-15 23:16
Munchies_Matt26-Jul-15 23:16 
GeneralRe: Calamari anyone? Pin
Kyle Moyer27-Jul-15 8:32
Kyle Moyer27-Jul-15 8:32 
GeneralNow we know why Griff started volunteering to cut the grass PinPopular
Dan Neely25-Jul-15 9:51
Dan Neely25-Jul-15 9:51 
GeneralRe: Now we know why Griff started volunteering to cut the grass Pin
Mike Hankey25-Jul-15 10:32
mveMike Hankey25-Jul-15 10:32 

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.