8086多处理是否有任何标准?(Is there any kind of standard for 8086 multiprocessing?)
回到我制作8086仿真器时,我注意到在多处理器环境中有用于同步的
LOCK
前缀。 然而,我知道x86拱门的唯一多任务处理。 涉及使用APIC,直到Pentiums或486s都没有出现。8086多任务处理是否有任何标准,还是由指令集和/或特殊端口的某些制造商特定扩展来完成?
按照标准,我的意思是:如果它们都使用相同的内存,你如何分开2个处理器? 如果没有某种方法使每个处理器执行不同的代码,这是不可能的。 (或仅在一个处理器上造成中断)
Back when I made an 8086 emulator I noticed that there was the
LOCK
prefix intended for synchonization in a multiprocessor environment. Yet the only multitasking I know of for the x86 arch. involves use of the APIC which didn't come around until either the Pentiums or 486s.Was there any kind of standard for 8086 multitasking or was it done by some manufacturer specific extensions to the instruction set and/or special ports?
By standard, I mean things like: How do you separate the 2 processors if they both use the same memory? This is impossible without some kind of way to make each processor execute a different piece of code. (or cause an interrupt on only one processor)
原文:https://stackoverflow.com/questions/2778278
最满意答案
以下代码现在编译并具有“newEvent”所需的类型签名
module FRP.Sodium where import Prelude import Control.Monad.Free import Data.Coyoneda import Data.Tuple data ReactiveF more = RFNewEvent (NewEventData -> more) type Reactive a = FreeC ReactiveF a data NewEventData = NewEventData forall a. Tuple (Event a) (a -> Reactive Unit) data Event a = ENever | EMerge (Event a) (Event a) | EFilterJust (Event (Maybe a)) | ECoalesce (a -> a -> a) (Event a) | EOnce (Event a) | ESplit (Event (Array a)) | EVar Int data Behaviour a = BVar Int extractNewEventData :: forall a. NewEventData -> (Tuple (Event a) (a -> Reactive Unit)) extractNewEventData (NewEventData x) = x newEvent :: forall a. Reactive (Tuple (Event a) (a -> Reactive Unit)) newEvent = map extractNewEventData $ liftFC $ RFNewEvent id
编辑
还尝试了purescript-exists。 使定义“样本”成为可能
RFSample被添加到ReactiveF ...
. . . data ReactiveF more = RFNewEvent (NewEventData -> more) | RFSample (SampleData more) . . . data SampleDataF more a = SampleDataF (Behaviour a) (a -> more) type SampleData more = Exists (SampleDataF more) sample :: forall a. Behaviour a -> Reactive a sample beh = liftFC $ RFSample $ mkExists $ SampleDataF beh id
谢谢Phil Freeman的评论。
The following code now compiles and has the desired type signature for "newEvent"
module FRP.Sodium where import Prelude import Control.Monad.Free import Data.Coyoneda import Data.Tuple data ReactiveF more = RFNewEvent (NewEventData -> more) type Reactive a = FreeC ReactiveF a data NewEventData = NewEventData forall a. Tuple (Event a) (a -> Reactive Unit) data Event a = ENever | EMerge (Event a) (Event a) | EFilterJust (Event (Maybe a)) | ECoalesce (a -> a -> a) (Event a) | EOnce (Event a) | ESplit (Event (Array a)) | EVar Int data Behaviour a = BVar Int extractNewEventData :: forall a. NewEventData -> (Tuple (Event a) (a -> Reactive Unit)) extractNewEventData (NewEventData x) = x newEvent :: forall a. Reactive (Tuple (Event a) (a -> Reactive Unit)) newEvent = map extractNewEventData $ liftFC $ RFNewEvent id
Edit
Also trying out purescript-exists. Makes it possible to define "sample"
RFSample gets added to ReactiveF ...
. . . data ReactiveF more = RFNewEvent (NewEventData -> more) | RFSample (SampleData more) . . . data SampleDataF more a = SampleDataF (Behaviour a) (a -> more) type SampleData more = Exists (SampleDataF more) sample :: forall a. Behaviour a -> Reactive a sample beh = liftFC $ RFSample $ mkExists $ SampleDataF beh id
Thank you Phil Freeman for your comment.
相关问答
更多-
>>=是一个函数,仅此而已。 它驻留在Prelude模块中,并且具有类型(>>=) :: forall ma b. (Bind m) => ma -> (a -> mb) -> mb (>>=) :: forall ma b. (Bind m) => ma -> (a -> mb) -> mb ,是Bind类型类的bind函数的别名。 您可以在此链接中找到Prelude模块的定义,可在Pursuit包索引中找到 。 这与Haskell中的Monad类型密切相关,它更容易找到资源。 关于这个概念有一个着名的问 ...
-
Purescript 0.12引入了较新版本的Effect和Console库,不幸的是,尚未更新pulp init以更正生成的示例以匹配(请参阅https://github.com/purescript-contrib/pulp/issues/337 ) 只需将Main.purs中的代码更新为: module Main where import Prelude (Unit) import Effect import Effect.Console (log) main :: Effect Unit mai ...
-
你快到了。 注意这一行: import Control.Monad.Eff.Console (CONSOLE, log) Control.Monad.Eff.Console提供log和logShow 。 为了解决你的特定问题,你只需要用logShow ( ( , CONSOLE ,是Effect的名字)之后的第一个名字替换这些parens之间的log 。 以防万一 - 两者之间的差异可以通过以下类型看出: log :: forall eff. String -> Eff (conso ...
-
PureScript中的记录(Records in PureScript)[2021-08-12]
Object 类型构造函数由一行类型参数化 。 在类型表示法中, Object有kind # * -> * 。 也就是说,它需要一行类型到一个类型。 ( value :: Number, values :: [Number] )表示一行类型 ( 类型为# *东西),所以它可以传递给Object来构造一个类型,即 Object ( value :: Number, values :: [Number] ) 请注意, { ... }仅仅是Object类型构造函数的语法糖,所以这与之相同 { value :: ... -
我认为listens是你正在寻找的功能: https : //pursuit.purescript.org/packages/purescript-transformers/1.0.0/docs/Control.Monad.Writer#v : listens ,如果我理解正确的话你在尝试做什么 如果你对转换值不感兴趣,你可以传入id ,如果你只想获得累积值,那么a <- snd <$> listens id就可以了。 I think listens is the function you're looki ...
-
Purescript中的变异状态(Mutating state in Purescript)[2022-12-11]
ST monad是一种很好的方法,但根据您的使用情况,可能有也可能没有标准库函数。 purescript-maps的Data.StrMap模块为具有字符串键的同类记录定义了一个外来类型,因此如果您的值都具有相同的类型,则可以使用Data.StrMap.ST来改变您的记录。 如果没有,您应该可以轻松地定义一个函数来使用ST和FFI更新记录。 棘手的一点是选择正确的类型。 如果您想为特定键执行某些操作,可以编写一个函数 setFoo :: forall r a h eff. STRef h { foo :: a ... -
以下代码现在编译并具有“newEvent”所需的类型签名 module FRP.Sodium where import Prelude import Control.Monad.Free import Data.Coyoneda import Data.Tuple data ReactiveF more = RFNewEvent (NewEventData -> more) type Reactive a = FreeC ReactiveF a data NewEventData = NewEv ...
-
PureScript FFI和Aff Monad:为什么效果永远不会运行?(PureScript FFI & Aff Monad: Why does the effect never run?)[2022-02-21]
如果您正在使用purescript-aff (v4或更高版本)的最新主要版本,那么Aff的运行时表示已更改,您无法再使用errback / callback函数样式直接创建它。 看看https://pursuit.purescript.org/packages/purescript-aff/4.0.2/docs/Control.Monad.Aff.Compat模块,特别是EffFnAff类型/ fromEffFnAff函数,以解释如何等价的东西现在有效。 或者你也可以使用makeAff构建Aff ,但这需要 ... -
您无法解释为特定值,因为解释器是作为自然变换提供的 - forall a. fa -> ga forall a. fa -> ga 。 这里的a不能被正在进行解释的函数“触及”。 您可以解释为Array或State String ,但a将始终由您正在解释的结构决定。 如果你知道你只想解释Free MyAlgebra Int -> Array Int那么这一切都会解决。 You can't interpret to a specific value, as interpreters are provided ...
-
看一下PureScript Prelude源码 ,我会这样说: instance functorFn :: Functor ((->) r) where map = compose -- point-free! 您在http://try.purescript.org/?session=3538ae1c-eece-8f50-ad0c-e1504846a793中的示例: foldr f z Nil = z foldr f z (x:xs) = f x (subfold xs) where subfo ...