quarta-feira, 2 de setembro de 2020

DICAS 3063 -WINDEV TUTORIAL 86 -Licao 7.6-09-09-2020 11hrs-The Threads












https://youtu.be/5nvpTSY_yhk

https://youtu.be/5nvpTSY_yhk


Bom Dia/Boa Tarde/Boa Noite

Esse Ao Vivo vai estrear as 11:00 do dia 09/09/2020 
DICAS 3063 -WINDEV TUTORIAL 86 -Licao 7.6-09-09-2020 11hrs-The Threads
Tutoriel WINDEV : Leçon 7.6. Programmation avancée - Les threads

ASSUNTOS

DEFINICAO THREADS
EXEMPLOS DE USO DE THREAD
MOSTRANDO O EXEMPLO PCSOFT
  THE THREADS
CRIADO UM PROJETO, REFAZENDO ESSE EXEMPLO 
  EM PORTUGUES,INGLES,FRANCES,ESPANHOL
EXECUTANDO THREAD_AMARILDO 
EXPLICANDO CADA LINHA DO CODIGO 
PROJETO ESTA NO REPOSITORIO WINDEV
  
Video original da Franca

Playlist Windev Tutorial Amarildo
Playlist windev Franca PcSoft
Amarildo
Windev
WxSolucoes
Matos Informatica
Repositorio Windev
Site forum Google 
Video sobre 3 Mil Videos Windev 
PlayList Pedrosao
Video sobre Alfaserver servidor 

DICAS 2979 - WINDEV TUTORIAL 2 - 1.2- CRIAR JANELA E INSERIR TEXTO E EXIBIR
DICAS 2980 - WINDEV TUTORIAL 3 - 2.1- VARIAVEIS PARTE 1
DICAS 2981 - WINDEV TUTORIAL 4 - 2.2- VARIAVEIS ESCOPO - PARTE 2
DICAS 2982 - WINDEV TUTORIAL 5 - 2.1- VARIAVEIS OPERADORES PARTE 3
DICAS 2983 - WINDEV TUTORIAL 6 - 2.1.D - VARIAVEIS STRINGS PARTE 4
DICAS 2984 - WINDEV TUTORIAL 7 - 2.1.E - VARIAVEIS ARRAYS PARTE 5
DICAS 2985 - WINDEV TUTORIAL 8 - 2.2.A - CONDICOES IF-SWITCH PARTE 1
DICAS 2986 - WINDEV TUTORIAL 9 - 2.2.B - CONDICOES PARTE 2
DICAS 2987 - WINDEV TUTORIAL 10 - 2.3.A - LOOP PARTE 1
DICAS 2988 - WINDEV TUTORIAL 11 - 2.3.B - LOOP EXEMPLOS PARTE 2
DICAS 2989 - WINDEV TUTORIAL 12 - Lesson 2.4. The procedures - PARTE 1
DICAS 2990 - WINDEV TUTORIAL 13 - Leçon 2.4.b. Procedures Parametros - PARTE 2
DICAS 2991 - WINDEV TUTORIAL 14 - PROCEDURES REFERENCIA - PARTE 3
DICAS 2992 - WINDEV TUTORIAL 15 - PROCEDURES OPCIONAIS OU OBRIGATORIAS - PARTE 4
DICAS 2993 - WINDEV TUTORIAL 16 - PROCEDURES EXEMPLOS - PARTE 5
DICAS 2994 - WINDEV TUTORIAL 17 - PERGUNTAS E RESPOSTA - PARTE 1
DICAS 2995 - WINDEV TUTORIAL 18 - PERGUNTAS E RESPOSTA - PARTE 2
DICAS 2996 - WINDEV TUTORIAL 19 - WINDEV E OS BANCOS DE DADOS
DICAS 2997 - WINDEV TUTORIAL 20 - PROJETO E ANALISE - CRIACAO
DICAS 2998 - WINDEV TUTORIAL 21 - PROJETO E ANALISE - ARQUIVOS DADOS CLIENTE - PARTE 2
DICAS 2999 - WINDEV TUTORIAL 22 - PROJETO E ANALISE - ARQUIVOS DADOS CRIACAO ARQUIVO PEDIDO - PARTE 3
DICAS 3000 - WINDEV TUTORIAL 23 - PROJETO E ANALISE - IMPORTANDO CVS-ARQUIVO TEXTO - PARTE 4
DICAS 3001 - WINDEV TUTORIAL 24 - PROJETO E ANALISE - IMPORTANDO ARQUIVO PRODUTO - PARTE 5
DICAS 3002 - WINDEV TUTORIAL 25 - PROJETO E ANALISE - LINK - PARTE 6
DICAS 3003 - WINDEV TUTORIAL 26 - RAD COMPLETO
DICAS 3004 - WINDEV TUTORIAL 27 - VISAO GERAL
DICAS 3005 - WINDEV TUTORIAL 28 - Adicionar e Modificar Janelas PRODUTOS - PARTE A
DICAS 3006 - WINDEV TUTORIAL 29 - Adicionar e Modificar Janelas PRODUTOS Formulario - PARTE B
DICAS 3007 - WINDEV TUTORIAL 30 - Adicionar e Modificar Janelas PRODUTOS ALINHAR CAMPOS - PARTE C


===================================

PROCEDURE MyWindow()

// CRIANDO AS VARIAVEIS QUE VAMOS PRECISAR QUE VAMOS PRECISAR
// CREATING THE VARIABLES THAT WE WILL NEED THAT WE WILL NEED
// CRÉER LES VARIABLES DONT NOUS AURONS BESOIN DONT NOUS AVONS BESOIN
// CREANDO LAS VARIABLES QUE NECESITAREMOS QUE NECESITAREMOS

gMyThreadCounter is a Thread
gMyThreadCounterWithBound is a Thread

// ADICIONANDO NA BARRA DE PROGRESSO UM VALOR MAXIMO
// ADDING A MAXIMUM VALUE TO THE PROGRESS BAR
// AJOUTER UNE VALEUR MAXIMALE À LA BARRE DE PROGRESSION
// AÑADIR UN VALOR MÁXIMO A LA BARRA DE PROGRESO

PROGRESSBAR_SIMPLE_THREAD..MaxValue=50000

============================

// click btn_run

// Para executar um processo em segundo plano, crie um procedimento que conterá
   // o código a ser executado. 
// To run a process in the background, create a procedure that will contain
     // the code to run.
// Pour exécuter un processus en arrière-plan, créez une procédure qui contiendra
    // le code à exécuter.
// Para ejecutar un proceso en segundo plano, cree un procedimiento que contendrá
    // el código a ejecutar.

gMyThreadCounter = ThreadExecute(Increment,())

// ThreadExecute permite que você execute o código do procedimento em segundo plano.
    // Retorna uma variável de thread.  Incremento é o nome do procedimento.
   // O código deste procedimento será executado em segundo plano.    
// ThreadExecute allows you to execute the code of the procedure in the background.
    // It returns a thread variable. Increment is the name of the procedure. 
    // The code of this procedure will be run in the background.
// ThreadExecute vous permet d'exécuter le code de la procédure en arrière-plan.
   // Il renvoie une variable de thread. Incrément est le nom de la procédure.
   // Le code de cette procédure sera exécuté en arrière-plan.   
// ThreadExecute le permite ejecutar el código del procedimiento en segundo plano.
   // Devuelve una variable de hilo. Incrément est le nom de la procédure.
   // Le code de cette procédure sera exécuté en arrière-plan.

BTN_Run..Visible =False
BTN_Stop..Visible =True

========================================


// click btn stop

// ThreadStop é usado para parar um processo iniciado na tarefa em segundo plano.
// ThreadStop is used to stop a process started in background task.
// ThreadStop est utilisé pour arrêter un processus démarré en tâche d'arrière-plan.
// ThreadStop se usa para detener un proceso iniciado en una tarea en segundo plano.

gMyThreadCounter.RequestStop()

BTN_Run..Visible =True
BTN_Stop..Visible =False


========================================

PROCEDURE Increment()
// Este procedimento incrementa e exibe o valor de um contador em um controle de edição
// This procedure increments and displays the value of a counter in an edit control
// Cette procédure incrémente et affiche la valeur d'un compteur dans un champ d'édition
// Este procedimiento incrementa y muestra el valor de un contador en un control de edición
FOR i = 1 TO 50 000
// Não manipule a IU em um thread. Um procedimento deve ser executado no thread principal.
// Do not manipulate the UI in a thread. A procedure must be run in the main thread.
// Ne manipulez pas l'interface utilisateur dans un thread. Une procédure doit être exécutée dans le thread principal.
// No manipule la interfaz de usuario en un hilo. Se debe ejecutar un procedimiento en el hilo principal.
ExecuteMainThread(DisplayCounter,i)
// Se a parada do thread foi solicitada, saia do loop
// If the thread stop has been requested, exit loop
// Si l'arrêt du thread a été demandé, quitter la boucle
// Si se ha solicitado la detención del hilo, salir del bucle
IF ThreadStopRequested() THEN
BREAK
END
ThreadPause(1)
END
// Fim do processo (este procedimento deve lidar com a IU para que seja executado no encadeamento principal) // End process (this procedure must handle the UI so it is run in the main thread)
// Fim do processo (este procedimento deve lidar com a IU para que seja executado no encadeamento principal) // Finalizar el proceso (este procedimiento debe manejar la interfaz de usuario para que se ejecute en el hilo principal)
ExecuteMainThread(EndProcess)
INTERNAL PROCEDURE DisplayCounter(nCounter)
EDT_COUNTER = nCounter
PROGRESSBAR_SIMPLE_THREAD = nCounter
END 

INTERNAL PROCEDURE EndProcess()
BTN_Stop..Visible = False
BTN_Run..Visible = True
END

========================================
















========================================












Lesson 7.6. The threads
This lesson will teach you the following concepts
  • What are the threads?
Lesson duration

Estimated time: 10 mn
Previous LessonTable of contentsNext Lesson
Definition
Threads allow running code (or processes) in parallel with the main application. Therefore, several long processes can be run in background task without locking the main application (also called "Main thread").
Threads replace some types of timers.
In most cases, a secondary thread is used to detect an event such as a user action, an incoming email, a phone call, ...
Examples for using threads:
  • Retrieving emails in background task while typing a new email.
  • Communication application: managing phone calls, communication by socket, etc.
WINDEV allows you to:
  • manage the threads (Thread* functions).
  • use "signals" in order to synchronize several threads (Signal* functions).
  • use the threads with "semaphores" in order to manage the access to the resources shared by different threads (Semaphore* functions).
Example

Example

WINDEV is supplied with several unit examples allowing you to understand the benefit and the use of threads:
  • The threads (Pool).
  • The threads.
See Management of threads for more details.


Nenhum comentário:

Postar um comentário

Teste

Teste
teste