message-passing

IPC in Message-Passing Systems - Direct Communication

ぃ、小莉子 提交于 2021-01-29 17:25:23
问题 According to the book 'operating systems concepts', it says: With direct communication, each process that wants to communicate must explicitly name the recipient or sender of the communication. This scheme exhibits symmetry in addressing. In this scheme, the send and receive primitives are defined as: Send(P, message): Send a message to process P receive (Q, message)-Receive a message from process Q. In asymmetry only the sender names the recipient; the recipient is not required to name the

What makes Erlang suitable for soft real-time applications?

我只是一个虾纸丫 提交于 2020-01-31 04:58:39
问题 Some background I'm working on building a programming language for digital media programming, which should support concurrency using no-sharing message passing and soft real-time (i.e. do your best to compute audio/video without losing samples or frames and with a constant throughput). It turns out that both these features are surprisingly difficult to combine, mainly because of one particular constraint: real-time code should not dynamically allocate memory. My language should make it easy

Communication between contentscript, background and popup scripts

一曲冷凌霜 提交于 2020-01-24 00:48:11
问题 On sending side : i.e from contentscript. contentscript.js: <script> //some DOM code to obtain values to store in 'marks' array. //here I'm sending marks array to background.js. // 1) Am I sending it right? chrome.runtime.sendMessage(marks); </script> On receiving end : i.e in background script.* background.js: chrome.runtime.onMessage.addListener(function(MessageSender sender, function sendResponse){ /* 2) what should be here */ }); 3) here , how can I collect(store) the array variable

Python assertRaises on user-defined exceptions

主宰稳场 提交于 2020-01-15 05:15:30
问题 The following question was triggered by the discussion in this post. Assume two files ( foobar.py and foobar_unittest.py ). File foobar.py contains a class ( FooBar ) with two functions ( foo and bar ). Function bar raises a built-in exception, function foo a user-defined exception. # foobar.py class MyException(Exception): pass class FooBar: def __init__(self): pass def bar(self): raise ValueError('Hello World.') def foo(self): raise MyException('Hello World.') . # foobar_unittest.py import

integrating single and long-lived messaging [duplicate]

有些话、适合烂在心里 提交于 2020-01-06 19:57:37
问题 This question already has answers here : Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference (6 answers) Chrome Cookie API isn't letting me use returned values (1 answer) Closed 4 years ago . I need to have two type communications, single messaging for retrieving initial information and long-lived messaging. Both messaging communicate with an external web page as follow. The returned response in the web page always is undefined!!! Where is the

integrating single and long-lived messaging [duplicate]

馋奶兔 提交于 2020-01-06 19:56:36
问题 This question already has answers here : Why is my variable unaltered after I modify it inside of a function? - Asynchronous code reference (6 answers) Chrome Cookie API isn't letting me use returned values (1 answer) Closed 4 years ago . I need to have two type communications, single messaging for retrieving initial information and long-lived messaging. Both messaging communicate with an external web page as follow. The returned response in the web page always is undefined!!! Where is the

Single instance app with message passing via cmd line?

橙三吉。 提交于 2020-01-05 04:24:24
问题 I have a C# app that is launched via command line. Usually data is pass through the command line such as add ( app -a string ). I would like only ONE instance of the app to be opened and if more strings are added via command line i would like the single instance to know about it and update itself. I can either put the data into the database properly and msg the running instance or msg and pass the data to the running instance and let it put it in the db and update itself. How would i do this

Firefox addon(JPM) - How to pass message from panel's script to content script?

 ̄綄美尐妖づ 提交于 2020-01-04 07:03:53
问题 Im trying to send a click event from panels script(popup.js) to content script(content.js) hers the code that i've tried.and the desired output isnt printing on the console. popup.html <button id="start-btn" onclick="myFunction()">Clip</button> popup.js function myFunction() { addon.port.emit('message', 'hello world'); } content.js self.port.on("message", function(text) { console.log(text); }); index.js(main) var panels = require("sdk/panel"); var self = require("sdk/self"); var data =

TPL Dataflow, whats the functional difference between Post() and SendAsync()?

大城市里の小女人 提交于 2019-12-28 05:35:09
问题 I am confused about the difference between sending items through Post() or SendAsync(). My understanding is that in all cases once an item reached the input buffer of a data block, control is returned to the calling context, correct? Then why would I ever need SendAsync? If my assumption is incorrect then I wonder, on the contrary, why anyone would ever use Post() if the whole idea of using data blocks is to establish a concurrent and async environment. I understand of course the difference

Why is the receiver thread not receiving anything in my Java piped streaming program? [duplicate]

╄→尐↘猪︶ㄣ 提交于 2019-12-26 11:39:47
问题 This question already has answers here : Why are empty catch blocks a bad idea? [closed] (20 answers) Closed 2 years ago . I have 3 very small classes. The main class: import java.io.*; public class ConnectionManager { public static void main(String argv[]) { try { PipedOutputStream pout = new PipedOutputStream(); PipedInputStream pin = new PipedInputStream(pout); Sender s = new Sender(pout, true); Receiver r = new Receiver(pin, true); System.out.println("Starting threads"); s.start(); r