message-passing

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

Deadly 提交于 2019-12-26 11:38:26
问题 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

another reliable way to do PULL-PUSH sync in ZeroMQ

烂漫一生 提交于 2019-12-25 05:20:13
问题 If you're using PUSH sockets, you'll find that the first PULL socket to connect will grab an unfair share of messages. The accurate rotation of messages only happens when all PULL sockets are successfully connected, which can take some milliseconds. As an alternative to PUSH/PULL, for lower data rates, consider using ROUTER/DEALER and the load balancing pattern. So one way to do sync in PUSH/PULL is using the load balancing pattern. For this specific case below, I wonder whether there is

Message passing in Chrome Extension

一个人想着一个人 提交于 2019-12-24 10:49:04
问题 I am quite confused about the what are counted as chrome extension view, which directly linked to what function I can use for passing messages between different components. Let me just describe what I am trying to do first; My background.html creates Desktop Notifications based on some events received from a node.js server through socket.io. When the user clicks on the notification, I want to create a new tab pointing to a html within my extension (/src/view/token.html), and then send some

chrome extension to Send Message from popup to content script

北战南征 提交于 2019-12-21 12:06:29
问题 I,am developing an extension in which i have to extract data from linkedin profile page when user press button on popup. I,am passing message from the popup.js page to contentscript and in response i will get data extracted from linkedin profile page by contentscript so that i can display it in popup.html. But I,am getting error when i inspected the popup.html. The error is: Port: Could not establish connection. Receiving end does not exist. lastError:29 Error in event handler for 'undefined'

Chrome Extension API: chrome.tabs.captureVisibleTab on Background Page to Content Script

丶灬走出姿态 提交于 2019-12-20 03:05:07
问题 My overall goal was to take a screenshot via the background page using: http://developer.chrome.com/extensions/tabs.html#method-captureVisibleTab and pass it to the content script so I can use the page's HTML DOM to analyze the screenshot and cut it up the way I would like. However, I can't seem to pass the dataUrl back to the content script with Message Passing: http://developer.chrome.com/extensions/messaging.html I tried JSON.stringify() but to no avail. This works perfectly fine:

Chrome Extension: Message Passing (Sending the DOM to popup.js) returns 'null'

末鹿安然 提交于 2019-12-19 11:40:18
问题 I would like to use a Chrome Extension to download the current page's DOM. I'm not sure why, but when my download occurs, the result is just a text file with either 'null' or 'undefined', rather than the DOM. I've tried to assimilate the knowledge from here and here, but I can't seem to get the message from content.js through to popup.js . Additionally, I'm not sure why this actually works. When I read the docs, it seems like I need to send the message from popup.js to content.js by selecting

Parallelism in Python

回眸只為那壹抹淺笑 提交于 2019-12-19 05:12:59
问题 What are the options for achieving parallelism in Python? I want to perform a bunch of CPU bound calculations over some very large rasters, and would like to parallelise them. Coming from a C background, I am familiar with three approaches to parallelism: Message passing processes, possibly distributed across a cluster, e.g. MPI . Explicit shared memory parallelism, either using pthreads or fork() , pipe() , et. al Implicit shared memory parallelism, using OpenMP . Deciding on an approach to

Chrome extension: sendMessage doesn't work

风流意气都作罢 提交于 2019-12-19 03:40:12
问题 I've already read the documentation from Google on 'message passing' a few times and have probably looked at over 10 other questions with the same problem and already tried quiet a few variations of most of their "solutions" and of what I have below... This is black magic, right? Either way, here it goes. Manifest File: { "manifest_version" : 2, "name" : "Message Test", "version" : "1.0", "browser_action": { "default_popup": "popup.html" }, "background": { "scripts": ["background.js"] },

Java: High-performance message-passing (single-producer/single-consumer)

删除回忆录丶 提交于 2019-12-13 11:49:37
问题 I initially asked this question here, but I've realized that my question is not about a while-true loop. What I want to know is, what's the proper way to do high-performance asynchronous message-passing in Java? What I'm trying to do... I have ~10,000 consumers, each consuming messages from their private queues. I have one thread that's producing messages one by one and putting them in the correct consumer's queue. Each consumer loops indefinitely, checking for a message to appear in its

Message passing between threads using a command file

寵の児 提交于 2019-12-13 03:57:24
问题 This project asked for 4 threads that has a command file with instructions such as SEND, Receive and quit. When the file says "2 send" the thread that in the second place in the array should wake up and receive its message. I need to know how to make a thread read it's message if the command file has a message for it? 回答1: The biggest issue I see for your design is the fact that each thread reads its line randomly independent from any other thread. After this it would have to check wether the