Re: [phix] what is a hybrid interpreter compiler?

new topic     » goto parent     » topic index » view thread      » older message » newer message
katsmeow said...

if the 2nd program crashes, it doesn't take the main program down with it.

Grand sweeping statements about this sort of thing would be so littered with ifs and buts and dos and donts if accurate they would be unreadable, but I'll give it a go.

It is much better and far easier to design a specific solution for a specific problem. I'll focus on "recover from crash".

Forget multi-tasking, if an individual task crashes it's game over, and try/catch won't help with infinite loops.

Multi-threading is slightly better, but it is still tricky to kill a crashed or looping thread (though restarting it should be easy enough).

You could perhaps write some tricky inline assembly to determine the machine address and size of some bit of code.

Neither multi-tasking nor multi-threading would have gained anything from getting the machine address anyway.

You cannot pass that machine address to a separate process and have it execute it. (Not since DOS 0.0.1 anyway)

You could peek the code and pass the whole lot, either as PIC (position independent code) or manually relocate it, very messy either way.

Far easier just to put the code in a separate process in the first place.

Communicating sequential processes is usually best. If you open Windows Task Manager and look at your browser (well at least a modern chrome-based one) you should see it has dozens of processes, so that if one page crashes it doesn't bring down the whole thing and it can put a message along with a restart button on the affected page.

That is all done with ipc, and/or OS-specific message passing for performance. Separate processes, code where it belongs, no machine addresses, tasks, or threads involved.

new topic     » goto parent     » topic index » view thread      » older message » newer message


Quick Links

User menu

Not signed in.

Misc Menu