woken | orchestration platform for Docker containers running data | Machine Learning library
kandi X-RAY | woken Summary
kandi X-RAY | woken Summary
An orchestration platform for Docker containers running data mining algorithms. This project exposes a web interface to execute on demand data mining algorithms defined in Docker containers and implemented using any tool or language (R, Python, Java and more are supported). It relies on a runtime environment containing Mesos and Chronos to control and execute the Docker containers over a cluster.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of woken
woken Key Features
woken Examples and Code Snippets
Community Discussions
Trending Discussions on woken
QUESTION
I have a very simple code snippet to test Jetty server 9.4.41. In the debug level logs I see Timeout Exceptions. I know it is related to idle timeout, and it happens when there is no read/write activity on the connection. But I am just wondering, am I supposed to get the exceptions in the logs? It looks like to me something is not right. I would appreciate if somebody can help to understand why I am getting this.
Here is my Jetty server code:
...ANSWER
Answered 2021-Jun-01 at 16:11I guess it should be something related related to keep-alive flag in the request header, correct me if I am wrong
Connection: keep-alive
means nothing in HTTP/1.1, as that's exclusively an HTTP/1.0
concept.
That value (keep-alive
) is ignored by Jetty when the request line contains HTTP/1.1
, and the resulting header is basically an header without a meaningful value (aka, default behavior for HTTP/1.1)
The request you made is for a persistent connection (the default behavior in HTTP/1.1), the response for the server also maintains that persistent connection.
The fact that you get a idle timeout is for the connection itself, not for any particular request, and is normal behavior for persistent connections that are not closed.
Note that the specific idle timeout you see is a DEBUG level event, and is not a warning/failure or anything else. Those would be logged at WARN level (or higher).
You can easily add a Connection: close
to the request and the connection will be closed.
You can also add Connection: close
on the server side and the response will be sent then the connection is closed.
QUESTION
I am making a game in which a player has three values; hunger, temperature, thirst. These three stats are meant to continuously decrease i.e, every one second, all three stats decrease by one. But the values shouldn't be displayed on the screen. Meanwhile, as the stats are decreasing, the user is supposed to be playing the game. The stats are only meant to be displayed when the user presses "e". Here is my code and what I have tried:
...ANSWER
Answered 2021-May-04 at 23:06In order to be able to decrease the player's stats while he is playing you can use the while
loop in a different thread/task.
Using threads with python is very simple:
First, you have to import threading:
QUESTION
sleep()
may work up earlier than specified because it can be woken up by a signal.
man page states:
The sleep() function suspends execution of the calling thread until either seconds seconds have elapsed or a signal is delivered to the thread and its action is to invoke a signal-catching function or to terminate the thread or process.
There is no man page for mach_wait_until()
. Can it also be interrupted by a signal? On an old Apple mailing list post someone claimed it won't but I ran into a situation that would only make sense if it does. Is that documented anywhere or does anyone have more insights on this topic?
ANSWER
Answered 2021-Apr-13 at 20:20It looks like it can.
Of course there is no documentation, it's not the Apple way to write a documentation.
But fortunatelly, we can check it with apple opensource xnu kernel: https://opensource.apple.com/source/xnu/xnu-7195.81.3/
I would say we are interesting in the file xnu-7195.50.7.100.1\osfmk\kern\clock.c There is a trap that implements mach_wait_until with such call:
QUESTION
Curl version: 7.71.0 with c-ares
BackgroundWe are building a library that's being integrated into mobile apps. We are targeting both iOS and Android. Curl initialisation happens in a static block inside the library.
The iOS version of the library is bundled into a framework, which is loaded at app startup, if i'm not mistaken. The Android version of the library is bundled in a module, which is lazily loaded. (I know this is an issue, especially since we link against OpenSSL, but it's probably important for context).
We built a small HTTP client with curl, that allows use to download some data blob from trusted servers.
Quick architecture reviewThe HTTP client is running on its own thread. It holds a curl_multi_handle
, and any transfer started append a curl_easy_handle
to it, and return a handle to a Response
that contains a buffer to read the received bytes from, and is used to control the transfer if needed.
Since cURL handles are not thread safe, any action (referred to as Tasks from now on) to the handle is dispatched to the HTTP client's thread, and a boost::shared_future
is returned (we might want to block or not depending on the use case).
Here is a rough idea of how the main loop is structured:
...ANSWER
Answered 2021-Mar-16 at 17:09Mobile operating systems such as Android and iOS have a different scheduling strategies for background processes compared to traditional *nix operating systems. The mobile OS tends to starve the background processes in order to preserve the battery time. This is know as background process optimization
and will be applied to the processes/threads of the application the moment application enters in background.
As of Android 7, the background processes are no longer informed about the network events with the CONNECTIVITY_ACTION broadcasts unless they register in the manifest that they want to receive the events.
Although the lobcurl
is used in android native code, the threads created from the native library will be subject of the entitlements that the application declared in the manifest (which need to be granted).
I know how frustrating a blocking issue can be so I can offer you a quick workaround to try until the problem is resolved.
curl_multi_poll()
can receive a timeout that in your code is set to a very_large_number
. In addition, the last parameter of the function call is a pointer to an integer numfds
that will be populated with the number of file descriptors on which an event occurred while the curl_multi_pool()
was pooling.
You can use this in your favor to construct a workaround in the following way:
- Make the
very_large_number
areasonably_small_number
- replace the
nullptr
with&numfds
- Surround the
curl_multi_poll
with ado ... while
loop
So you will have something like this:
QUESTION
I am new to basic concurrency in Java. As far as I understood, it is possible to have several threads inside a synchronized block if only one of them is active and the other ones are waiting. As I am learning with a book on java, I was trying to solve an exercise concerning the reader-writer-problem with 3readers that are supposed to read the numbers, and 3 writers how print out the numbers from 0 to 4 and then end. The main class, writer class and reader class (see below) were given. The official solution that my book gives is this ("Erzeuger" is supposed to be "writer", "Verbraucher" is supposed to be "reader", "Wert" is the value that is set): main class value class writer class reader class
But would I not run into a deadlock if at the beginning all readers go into the waiting state of the get Method because there is no value available yet and the "verfuegbar" flag is false. Then a value could be created by one of the writers and one reader could get woken up by notify, then all three writers could go into the waiting state of the put method, then the reader could read the value, then another reader could get woken up and so they all land inside of the waiting method and it is a deadlock?
What am I missing here, or is the book's solution wrong? Thanks in advance!
...ANSWER
Answered 2021-Mar-15 at 14:37It is recommended you have general working idea of software systems before you proceed with Java concurrency. You will gain more insight on solving your problem once you understand how semaphores, mutex locks, etc work, concepts of deadlock conditions, avoidance & prevention, etc.
I recommend you read up to Chapter 6 of William Stalling's Operating Systems: Design & Principles.
QUESTION
In my project I spawn a worker thread which deals with an information source. It needs to poll a source (to which it is subscribed) and, whenever needed, change the subscription (i.e. telling the source that the filter criteria for the information it needs have changed).
Polling the source happens at regular intervals, in the minutes range. Changes to the subscription need to be triggered immediately when the main thread identifies the condition for doing so. However, since the operation can be lengthy, it needs to run on the worker thread.
So the worker thread looks like this (in pseudo code—real code is in C):
...ANSWER
Answered 2021-Mar-08 at 12:08You can use pthread_cond_wait()
to wait for a signal from the main thread that the condition was met and the work can resume (ex. wait for the subscriptionChangeNeeded
to change). This will remove the need to use sleep, however once the thread is suspended on this call, the only way to resume it is to call the pthread_cond_signal()
.
If your worker thread's loop has other tasks to do and you depend on periodical wake-ups,
you can use the pthread_cond_timedwait()
to wait for the subscriptionChangeNeeded
to change; or for a timeout to be reached; whatever happens first.
The main thread will have a task to identify the change in the condition and once it has identified that there is need for the update, main thread will call pthread_cond_signal()
to inform the writer thread that he needs to wakeup. If the signal is not received in the time specified as a timeout, the thread will resume (wake up), even if the condition was met, so this is similar to sleep
Regardless on which one occurs first (the time-out or the condition change), the thread will be resumed and he can perform the changeSubscription();
.
You can check more details and examples here
This are POSIX functions defined in pthread.h
QUESTION
I've been struggling with a multithreading issue for a bit. I've written some simple code to try and isolate the issue and I'm not finding it. What's happening is that the first thread is being woken up with data being sent to it, but second one never does. They each have their own condition_variable yet it doesn't seem to matter. Ultimately, what I'm trying to do is have a few long running threads that do a single dedicated task when needed, and staying in a wait state when not needed. And running them each in their own thread is important and a requirement.
Here's the code:
...ANSWER
Answered 2021-Mar-03 at 21:35You should initialize all elements of the built-in array:
QUESTION
I am finding it difficult to understand why and when I need to explicitly do something with the Context
and/or its Waker
passed to the poll
method on an object for which I am implementing Future
. I have been reading the documentation from Tokio and the Async Book, but I feel the examples/methods are too abstract to be applied to real problems.
For example, I would have thought the following MRE would deadlock since the future generated by new_inner_task
would not know when a message has been passed on the MPSC channel, however, this example seems to work fine. Why is this the case?
ANSWER
Answered 2021-Feb-11 at 11:50You are passing the same Context
(and thus Waker
) to the poll()
method of the Future returned by new_inner_task
, which passes it down the chain to the poll()
of the Future
returned by UnboundedReceiverStream::next()
. The implementation of that arranges to call wake()
on this Waker
at the appropriate time (when new elements appear in the channel). When that is done, Tokio polls the top-level future associated with this Waker
- the join!()
of the three futures.
If you omitted the line that polls the inner task and just returned Poll::Pending
instead, you would get the expected situation, where your Future
would be polled once and then "hang" forever, as nothing would wake it again.
QUESTION
I'm having a hard time interpreting Intel performance events reporting.
Consider the following simple program that mainly reads/writes memory:
...ANSWER
Answered 2021-Jan-26 at 18:40Not exactly "memory" bound, but bound on latency of store-forwarding. i9-9900K and i7-7700 have exactly the same microarchitecture for each core so that's not surprising :P https://en.wikichip.org/wiki/intel/microarchitectures/coffee_lake#Key_changes_from_Kaby_Lake. (Except possibly for improvement in hardware mitigation of Meltdown, and possibly fixing the loop buffer (LSD).)
Remember that when a perf event counter overflows and triggers a sample, the out-of-order superscalar CPU has to choose exactly one of the in-flight instructions to "blame" for this cycles
event. Often this is the oldest un-retired instruction in the ROB, or the one after. Be very suspicious of cycles
event samples over very small scales.
Perf never blames a load that was slow to produce a result, usually the instruction that was waiting for it. (In this case an xor
or add
). Here, sometimes the store consuming the result of that xor. These aren't cache-miss loads; store-forwarding latency is only about 3 to 5 cycles on Skylake (variable, and shorter if you don't try too soon: Loop with function call faster than an empty loop) so you do have loads completing at about 2 per 3 to 5 cycles.
You have two dependency chains through memory
- The longest one involving two RMWs of
b
. This is twice as long and will be the overall bottleneck for the loop. - The other involving one RMW of
a
(with an extra read each iteration which can happen in parallel with the read that's part of the nexta ^= i;
).
The dep chain for i
only involves registers and can run far ahead of the others; it's no surprise that add $0x1,%rax
has no counts. Its execution cost is totally hidden in the shadow of waiting for loads.
I'm a bit surprised there are significant counts for mov %edx,a
. Perhaps it sometimes has to wait for the older store uops involving b
to run on the CPUs single store-data port. (Uops are dispatched to ports according to oldest-ready first. How are x86 uops scheduled, exactly?)
Uops can't retire until all previous uops have executed, so it could just be getting some skew from the store at the bottom of the loop. Uops retire in groups of 4, so if the mov %edx,b
does retire, the already-executed cmp/jcc, the mov load of a
, and the xor %eax,%edx
can retire with it. Those are not part of the dep chain that waits for b
, so they're always going to be sitting in the ROB waiting to retire whenever the b
store is ready to retire. (This is guesswork about how mov %edx,a
could be getting counts, despite not being part of a real bottleneck.)
The store-address uops should all run far ahead of the loop because they don't have to wait for previous iterations: RIP-relative addressing1 is ready right away. And they can run on port 7, or compete with loads for ports 2 or 3. Same for the loads: they can execute right away and detect what store they're waiting for, with the load buffer monitoring it and ready to report when the data becomes ready after the store-data uop does eventually run.
Presumably the front-end will eventually bottleneck on allocating load buffer entries, and that's what will limit how many uops can be in the back-end, not ROB or RS size.
Footnote 1: Your annotated output only shows a
not a(%rip)
so that's odd; doesn't matter if somehow you did get it to use 32-bit absolute, or if it's just a disassembly quirk failing to show RIP-relative.
QUESTION
Why does my code act like I'm answering yes to a question when I'm answering no?
In this part of my code:
...ANSWER
Answered 2020-Nov-13 at 19:23This line is wrong:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install woken
Git-clone this repository.
Change directory into your clone:
Build the application
Docker 18.09 or better with docker-compose
Run the application
Httppie
Create a DNS alias in /etc/hosts
Browse to http://frontend:8087 or run one of the query* script located in folder 'tests'.
For production, woken requires Mesos and Chronos. To install them, you can use either:.
mip-microservices-infrastructure, a collection of Ansible scripts deploying a full Mesos stack on Ubuntu servers.
mantl.io, a microservice infrstructure by Cisco, based on Mesos.
Mesosphere DCOS DC/OS (the datacenter operating system) is an open-source, distributed operating system based on the Apache Mesos distributed systems kernel.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page