concurrency

Esempio di Ping pong thread Java

Sto cercando di capire le basi del thread e come primo esempio creo due thread che scrivono una stringa sullo stdout. Come so ... PING PING pong pong Qualcuno può spiegare cosa mi manca, e perché non sto ottenendo Ping pong... ping pong. Grazie!

Java Executor: compiti piccoli o grandi?

Considera una grande attività che potrebbe essere suddivisa in centinaia di piccole attività eseguibili indipendentemente. Pe ... ificazione e altre cose, è meglio creare molte piccole attività o raggrupparle in un numero inferiore di attività più grandi?

Processi paralleli Java con fork

Mi chiedevo se fosse possibile in Java creare più processi (sì, processi, non thread) per eseguire alcuni lavori paralleli. A ... al libro che lo fa, ti sarei molto grato. Mi ho visto molti libri Java per la concorrenza, ma solo per thread e non processi.

Cosa significa" passaggi computazionali di base " nelle specifiche per la classe Java ForkJoinTask?

Ho usato il framework Fork/Join concurrency di Java7 e funziona bene. Alla fine sono riuscito a leggere javadoc dell'API per ... nizione formale. Qualcuno può evocare alcune righe di Java e quindi scomporlo nei "passaggi computazionali di base"associati?

metti (s) e prendi(s) in BlockingQueue Java

Ecco l'esempio. class Factory { Queue<Object> queue = new LinkedBlockingQueue<Object>(); public Object ... o è possibile che due azioni put() si verifichino una dopo l'altra e solo dopo che i thread in attesa torneranno ? Grazie.

Come implementare un intero atomico in Java App Engine?

Sto cercando di implementare il mio sistema di verifica SMS per la mia app. Non voglio iniziare a pagare per un servizio e po ... in modo che i numeri di telefono siano chiamati in modo uguale e periodico? Ancora una volta, questo è per Google App Engine.

Implementazione del pool di thread Java basic con blocchi.Blocco di rientro

Sono nuovo a Java. Stavo solo sperimentando i thread e volevo creare qualcosa come un pool di thread (se questo è in realtà q ... alternativa delle variabili esterne (usando gli array valore): http://c2.com/cgi/wiki?ClosuresThatWorkAroundFinalLimitation

Java 9 Richiesta HTTP multithread

Non riesco a capire come nascondere correttamente il seguente codice sequenziale in un multi-thread. Ho fatto del mio meglio ... onds to fetch http://www.telewebion.com/ with title تلوبیون | مرجع پخش زنده و دانلود فیلم ، سریال و سایر برنامه های تلویزیون

Problema di threading rivelato con Java tutorial su OSX High Sierra

Ho seguito insieme al caso di studio Java su cleancoders.com Https://cleancoders.com/videos/java-case-study Puoi anche t ... omunque, sono in grado di continuare quindi, non bloccato. Ho intenzione di cambiare il titolo però per riflettere questo.

Come capire un esempio di concorrenza java del libro in pratica? [duplicato]

Questa domanda ha già delle risposte qui: ... e) dopo if(test != null)? Perché penso che il campo test possa essere impostato null dall'altro thread dopo if(test!=null).

Thread-safe ArrayList

I'm writing my implementation of a thread-safe error list on CAS-locks (don't ask why). I encountered some behavior that I di ... ments, this behavior also occurs, only much less often. I would be grateful if someone could tell me what's going on. Thanks.

Wait for Java threads to execute

Good afternoon! My task is to make ScheduledThreadPool, push execute threads into it, and stop the current thread until all t ... it does not respond to the interrupted thread and continues to wait for the timeout. Are there any other solutions? Thank you

Problem with thread execution order in Java

There is a task Develop a multithreaded application. Use opportunities, provided by the java.util.concurrent package. ... ed for a long time I'm new to multithreading, so I need some advice on how to make the application work correctly, thank you

java thread. stop () why deprecated

The translation of the documentation did not make the subject clearer for me: Because it's inherently insecure. This caus ... ime after a real accident, in a few hours or even days. Can you give an example where calling this method is really unsafe?

Volatile vs Atomic

What is the difference between the volatile modifier and the classes from java.util.concurrent.atomic? What can the latter do ... le? Why? And please provide a use case for volatile? In what situations is it (the modifier) still in demand and sufficient?

Java Atomic-are variables really atomic?

As you know, there are a number of Atomic shells for primitives. The main principle is that they do not use the usual synchro ... in current? Especially since value is declared as volatile, which means that this value is common to all potential threads.

Question about the availability of fields and methods of the synchronized block object

Passed the final exam for intuit.ru. Course on java, the next question about synchronized - block received that the answer is ... can also access the fields, i.e. option 4 is not suitable...) Maybe something has changed since 2003... (the course is old)

Vector, Hashtable. What is the disadvantage of synchronization?

Vector, HashTable, Stack are deprecated collections, and write that they are not used due to the synchronization of their met ... ronized collections in the concurrent package? Sorry for the stupid question, very interesting simple. Thank you in advance.