Re: spin lock



Krishna Myneni wrote:
Elizabeth D Rather wrote:
....
From your description, I gather that GRAB and RELEASE are equivalent to the spin
lock and unlock methods, while GET uses a scheduling scheme to grant access to
the resource and prevent one task from hogging the shared resource. It may be
that I have to implement something similar for my application as well.

When you say that tasks always PAUSE during I/O, is this the POSIX pause() function?

No, unless they coincidentally do the same things ;-) The SwiftOS multitasker (which technically is identical to the polyFORTH multitasker and generations before that) runs standalone (multitasking under Windows is quite different). It's basically a round-robin, with the rule that whenever a task initiates I/O it relinquishes the CPU and remains inactive (other tasks can run) until the I/O is complete. A task can also voluntarily pause any other time, e.g. during a CPU-intensive operation.

Cheers,
Elizabeth

--
==================================================
Elizabeth D. Rather (US & Canada) 800-55-FORTH
FORTH Inc. +1 310-491-3356
5155 W. Rosecrans Ave. #1018 Fax: +1 310-978-9454
Hawthorne, CA 90250
http://www.forth.com

"Forth-based products and Services for real-time
applications since 1973."
==================================================
.



Relevant Pages

  • Re: spin lock
    ... the resource and prevent one task from hogging the shared resource. ... When you say that tasks always PAUSE during I/O, is this the POSIX pausefunction? ... multitasker runs standalone. ... Elizabeth D. Rather 800-55-FORTH ...
    (comp.lang.forth)
  • Changing how PCI-PCI bridges do resource allocation
    ... I/O resource windows. ... I/O window when growing is required. ... some machines' BIOS clearing the I/O windows on some PCI-PCI bridges when ACPI ...
    (freebsd-arch)
  • Re: Explain this about threads
    ... I've created a thread how can I "block" while I wait for a resource to come availiable? ... Sleepis also a blocking method. ... Again, these are synchronization mechanisms, but this time rather than having one thread explicitly waiting and another explicitly signaling, they are ways of having both threads indicate to the OS "hey, I want this resource" and then allowing the OS to do the hard work of ensuring that only one thread is runnable at a time while they are using that resource. ... Pretty much any form of i/o you can do involves at some level a call to a low-level OS function that uses some internal signaling method to allow the OS to make your thread unrunnable until the i/o completes. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Splash Screens , how could something so basic still be hard?
    ... processing triggered by socket I/O. ... more time is spent using the CPU than the i/o resource. ... A single thread can be sufficient to handle hundreds ... having multiple threads using different i/o resources ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [lm-sensors] Could the k8temp driver be interfering with ACPI?
    ... But there is also a performance penalty for legitimate I/O access, ... I thought Rudolf's patch allocated the resource in the driver ... Since ACPI never *really* wants to allocate the ... In fact Rudolf's solution is nice for LPC chips, ...
    (Linux-Kernel)