Results 1 to 9 of 9

Thread: Multitasking

  1. #1

    Thread Starter
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    Does anyone know where there are some good multi-tasking/multi-threading/multi-processing samples in C???

    If not, can at least help me create a sample? I have a sample here, but I need a little help with it. Thanks.
    Designer/Programmer of the Comtech Operating System(CTOS)

  2. #2
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

  3. #3

    Thread Starter
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    I forgot to say something. It has to be DOS compatible source code. It's for my new OS. I need it to be multi-tasking/threading. The OS will use DOS as a base to start the PC and then DOS will run my OS which will start the OS's GUI system. But first, DOS multi-tasking samples are needed.
    Designer/Programmer of the Comtech Operating System(CTOS)

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    DOS doesn't support multithreading. You're going to have to write your own scheduler/thread handling system
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    I know. I've done MASSIVE amounts of research, but it seems very complicated. I've found a sample called "Micro-thread". It says it may crash, it's not mean't for big high-performance programs(Or operating systems?), and that it needs some work. I have however found something multi-tasking with a scheduler built-in. It seems good. I works as follows:

    1) Do thread1 until 1 clock tick has passed.
    2) Suspend the thread, run thread2 for 1 clk pulse.
    3) Suspend thread2, and run thread3 for 1 clk pulse.
    4) Suspend thread3, and resume thread1. Go back to beginning.

    It seems to be good. Here, I'll give it to you guys so you can check it. I found it on www.programmersheaven.com
    Please add stuff to it. If you have another sample or a better sample, PLEASE post it. The sample says that DOS is non-reentrant. What the h*** is that? It also says that you can't use calls like int86 and int86x while the threading is running. It also says there is a way to fix it. Can someone please help???
    Attached Files Attached Files
    Designer/Programmer of the Comtech Operating System(CTOS)

  6. #6
    Addicted Member KrishnaSantosh's Avatar
    Join Date
    Feb 2001
    Location
    Coimbatore
    Posts
    210
    Honestly I dont know much of C/C++. But I read somewhere that Multiplexer Interrupt could be handled such that task switching is more stable. And can also make your program re-entrant.

    Any way I'm Not Sure.

    Can Anyone tell me which powerful language to use to create standalone, efficient and faster EXEs.

    Thanx.

  7. #7
    Lively Member
    Join Date
    Jun 2000
    Posts
    122
    KrishnaSantosh
    Assembly is your best choice

  8. #8
    Guest

    Talking

    Hey Warmaster199, I am VERY interested in seeing what you got for an OS..

  9. #9

    Thread Starter
    Hyperactive Member Warmaster199's Avatar
    Join Date
    Aug 2000
    Location
    Canada
    Posts
    306
    Really? So far, it's not much... It'll have some options that MS forgot about(shhhhh... don't tell them ). Here's a good one... You all know what a CMOS chip is(I hope). It's a chip that holds info on the hardware settings and stuff and it's battery powered(uh-oh...). If these batteries die, that chip loses it's data, and then you have to reset all of the configs... Believe me, It's not fun CTOS will be able to get the CMOS settings and save them to a file. If the CMOS battery dies, just type in the CMOS settings you think will work, load CTOS and tell it to restore the CMOS settings. It's something a genious would think about!!! That's only 1 small thing that's easy to work out(The CMOS saver/loader is finished).

    Now I've got multi-tasking to worry about. This is HARD SH*T!!! I have to synchronize all of CTOS's routines together, seemlessly, like Windows... uh... not like Windows, I don't like the crashes.

    For the multi-threading, I'll need a thread for the VMem system, a thread for the GUI drawing routines. In win, it's GDI for drawing. Kernel32.dll does most of the multi-tasking/multi-processing jobs.

    At this rate, we'll be able to see an early version of CTOS shortly(A couple months). With more help, we can get it done faster.

    People, bring me some assembly code for the routines you feel should be done quickly(Multi-tasking & Low level mem routines). I'll be able to use it now that I'm using BorlandC 5.0 instead of PowerC.

    KrishnaSantosh, could you please find that document? It would prove useful!

    BTW: I am happy to hear that people are looking forward to this. If you have more questions on CTOS, please reply in my thread in the "Project Request" forum. Thankyou.
    Designer/Programmer of the Comtech Operating System(CTOS)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width