flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Is multithreading impossible in DOS ? | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
Total Votes : 15 |
Author |
|
DOS386 14 Mar 2008, 02:22
.
. Download now : http://board.flatassembler.net/download.php?id=3666 . . Code: ; ; REAL MODE Multithreading (ISR) example, 8086-compatible ; ; Compile with FASM, but this should REALLY be no longer surprising Enjoy ![]() EDIT: Bugged php-BB decided to mess up my poll today, 10 edits needed to finally (?) fix it ![]() Last edited by DOS386 on 14 Mar 2008, 03:25; edited 10 times in total |
|||
![]() |
|
f0dder 14 Mar 2008, 02:27
So, does it take care of multi-core/multi-cpu systems, and does it save SSE register state?
![]() |
|||
![]() |
|
f0dder 14 Mar 2008, 07:49
Quote: NO. I prefer 2 cores/CPU's on 2 mainboards , multiple cores on one mainboard is useless, maybe except in some very very very very very very rare situations Anyway, I wouldn't really call your example 'multi-threading'. Sure, having timer-tick controlled progress indication is fine and everything, but it's not multi-threading ![]() |
|||
![]() |
|
Dex4u 14 Mar 2008, 13:14
To me you have multi-tasking running more than one program at the same time (not really at the same time, but simulatered to seem like at the same time).
Multi-threading running more than one thread in a program at the same time (or simulatered to seem like at the same time, as above) Now if you hook the timer int and use basic multi-tasking code in side a program, to run many threads, then you are multi-threading, and this is very simple to do code, if you put this code for example into a com file you would have multi-threading http://www.dex4u.com/ASMcompo512b/nanoos2.zip Also i would say it easer to implement multi-threading in a single tasking OS, than A multi-tasking OS. |
|||
![]() |
|
roboman 15 Mar 2008, 02:02
Well there was concurent dos, not the same thing, a multi tasking dos. There were also a few bbs programs and games that could multi thread, but in some cases they blew off so much that you might argue they were no longer in dos and were in effect their own os...
|
|||
![]() |
|
edfed 15 Mar 2008, 03:25
what will set the priority for the drivers?
the application can use it's own driver, but the main can stop or switch with it's own drivers. how to make it? is it a sort of multithread/task ISR, with a kernel level emulation of application's ISR? |
|||
![]() |
|
DOS386 16 Mar 2008, 00:26
Dex wrote:
Quote: ... YES, it's only an approach to multi-threading, not -tasking ![]() edfed wrote: Quote: ... ![]() ![]() |
|||
![]() |
|
Dex4u 16 Mar 2008, 17:08
DOS386 wrote: Dex wrote: Most people do not know the difference ![]() For those who do not know the difference: http://zone.ni.com/devzone/cda/tut/p/id/6424 |
|||
![]() |
|
rugxulo 17 Mar 2008, 17:56
Dex, I'm surprised you didn't mention explicitly the XBox, which is one task with something like three? threads.
And BTW, yes DOS can multitask (DesqView, DR-DOS, Win 3.x). You can use certain software to write such (e.g. XS compiler or DX-Forth). EDIT: BTW, nice job, but why is the example so, er, useless? Creating a 40 MB file?? I mean, I assume you have a reason, but still .... ![]() |
|||
![]() |
|
Dex4u 17 Mar 2008, 20:18
rugxulo wrote:
Also Dos's TSR, is a basic forum of multi-tasking. |
|||
![]() |
|
DOS386 19 Mar 2008, 12:37
rugxulo wrote: yes DOS can multitask (DesqView, DR-DOS, Win 3.x) Not DOS ![]() Quote: nice job, but why is the example so, er, useless? Creating a 40 MB file?? I mean, I assume you have a reason, but still 1. Examples are usually "useless" 2. Creating a huge file ... to get time for showing the progress indicator ![]() 3. Should I create an example of progress indicator applied to a sophisticated compiler, compressor, brutal-forcer instead ? An "example" with several 10'000's lines ? ![]() _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
![]() |
|
System86 22 Mar 2008, 23:31
Also, why do you put "define pope pop"? Why not just use "pop reg" and replace "pope" with "pop" in your code?
|
|||
![]() |
|
System86 22 Mar 2008, 23:37
Any system that supports interrupts can theoretically do multitasking, just save state and jump to another thread or task when a certain interrupt occurs.
|
|||
![]() |
|
edfed 22 Mar 2008, 23:40
yes, for example, window$, it creates a V86 module in pm linear address space, but when i set the new ISR for keyboard, there are two drivers for the keyboard:
mine, that is intended to be alone, and m$ that can still read keyboard with it's own interface, and switch task (ctrl+tab) even if the keyboard isr is not dos compatible. then how does it works???? if i set a timer interupt, it don't act really as real timer, because the main os will continue to work over this... |
|||
![]() |
|
revolution 22 Mar 2008, 23:47
edfed wrote: yes, for example, window$, it creates a V86 module in pm linear address space, but when i set the new ISR for keyboard, there are two drivers for the keyboard: |
|||
![]() |
|
System86 23 Mar 2008, 00:54
When the CPU is in vm86 mode and an interrupt occurs, the system switches into protected mode to handle the interrupt. The pmode int handler may or may not call the vm86 handler, it's up to the pmode handler to decide if to reflect the interrupt back into virtual 8086 mode. In the case of windows, it handles some keystrokes on its own and others it sends to the vm86 task. So its true, interrupts (and hardware in general) is emulated in a vm86 task under Windows.
|
|||
![]() |
|
revolution 23 Mar 2008, 01:57
System86 wrote: Any system that supports interrupts can theoretically do multitasking, just save state and jump to another thread or task when a certain interrupt occurs. |
|||
![]() |
|
sakeniwefu 23 Mar 2008, 10:22
Multithreading is possible in any CPU. What's limited is the kind of multithreading/multitasking that is possible. It also may depend on the machine.
MMU - Protected Mode Preemptive Multitasking(Windows NT, Linux) Timer Interrupts - Preemptive Multitasking(Some hobby OS?) no Interrupts, or too slow context switch - Cooperative Multitasking(MacOS Classic, Win 3.1 and below) I wrote a preemptive multitasking task switcher for the ZX Spectrum PC(3KHz Z80 48k RAM) using timer interrupts that saved the 8080 compatibility registers and ran at decent speed, so MS-DOS is obviously able to do it, but probably cooperative multitasking will be faster. |
|||
![]() |
|
revolution 23 Mar 2008, 11:02
sakeniwefu wrote: Multithreading is possible in any CPU. I know the new PIC 18xx series has two stacks and can thus implement dual threading, clearly the designers got too many complaints and made a few small changes to help the programmers out. |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.