[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Hairy brainstorm

Aaron Brady

2/16/2008 2:05:00 AM

Hold the future holds effectively nothing for single-threaded
programs; single-core PUs have reached the point of diminishing
returns of circuit size and IC design; thinking multi-threaded's the
way to go.

Recognizing that even in event-driven programs, order of execution is
important, what does a new thread for each event in a Gui TK look like?
2 Answers

Aaron Brady

2/16/2008 5:44:00 AM

0

On Feb 15, 8:04 pm, castiro...@gmail.com wrote:
> Hold the future holds effectively nothing for single-threaded
> programs; single-core PUs have reached the point of diminishing
> returns of circuit size and IC design; thinking multi-threaded's the
> way to go.
>
> Recognizing that even in event-driven programs, order of execution is
> important, what does a new thread for each event in a Gui TK look like?

Caviat, an OS may design event notifications flows to return values.

Can an OS, speaking strictly abstractly, spawn a separate thread upon
an interrupt? ...-tion?

Aaron Brady

2/19/2008 9:33:00 PM

0

On Feb 15, 11:43 pm, castiro...@gmail.com wrote:
> On Feb 15, 8:04 pm, castiro...@gmail.com wrote:
>
> > Hold the future holds effectively nothing for single-threaded
> > programs; single-core PUs have reached the point of diminishing
> > returns of circuit size and IC design; thinking multi-threaded's the
> > way to go.
>
> > Recognizing that even in event-driven programs, order of execution is
> > important, what does a new thread for each event in a Gui TK look like?
>
> Caviat, an OS may design event notifications flows to return values.
>
> Can an OS, speaking strictly abstractly, spawn a separate thread upon
> an interrupt?  ...-tion?

In Windows, events either come from one's main loop:

while( GetMessage( &arg ) )
DispatchMessage( &arg );

(DispatchMessage calls HandlerProc), or are a direct callback /of/
HandlerProc, registered with the system, by the system. Premise:
Order is unimportant. Add these APIs:

while( GetMessage( &arg ) )
DispatchMessageThdd( &arg );

Either: DispatchMessageThdd and the system call HandlerProc in "the
right" thread: an existing one, if the event is in a special sequence,
or a new one otherwise; Or, they always calls HandlerProc in a new
thread, and when order is important, one can synchronize.
Complicated, but distributed.

Messages can be disserialized in at least one case. Serial APIs
remain. DispatchMessageThdd raises the performance ceiling in the
abstract case.