Dangerous Threads Crew

Related tags

Miscellaneous dtc

Dangerous Threads Crew

This is a very simple example program to illustrate how you move CreateWindow/DestroyWindow onto a separate thread if you need your API architecture to allow the main thread to create and destroy windows in an arbitrary way.

It may seem like a strange thing to do, but unfortunately Win32 internals have some really bad behavior during sizing and dragging windows that make it difficult for real-time rendering applications to properly continue what they're doing during those events without interruption. Moving CreteWindow/DestroyWindow onto a separate thread moves the message processing for all windows onto that separate thread, thereby preventing Windows' message processing from interrupting your main threads.

- Casey

  • [Question] Could we use Fibers to solve this problem?

    [Question] Could we use Fibers to solve this problem?

    Hi Casey,

    Your post has reminded me of a Handmade Bitwise's stream from Per Vognsen.

    I remember him using a Fiber to solve this problem. I'm a beginner in the Windows programming world, so I was wondering if you could comment on what are the tradeoffs between those 2 approaches.

    Thanks for sharing your knowledge and enthusiasm about system programming.

    Regards, -Gabriel

    opened by g-berthiaume 2
  • Typo inside the README

    Typo inside the README

    Hi! Thank you for continuing handmade hero, it is the single best source to learn how to actually programming for me.

    Minor thing, but just wanted to inform you that there's a typo inside the README.

    'Moving CreteWindow/DestroyWindow' ->I guess what you wanted to say was 'Moving CreateWindow/DestroyWindow'?

    Again, thank you for your continuous effort for teaching, and hope you have a great day!

    opened by gyuhyun-lee 1
Casey Muratori
Programmer at Molly Rocket on 1935 and host of Handmade Hero
Casey Muratori
Inter-process communication library to enable allocation between processes/threads and send/receive of allocated regions between producers/consumer processes or threads using this ipc buffer.

This is a relatively simple IPC buffer that allows multiple processes and threads to share a dynamic heap allocator, designate "channels" between processes, and share that memory between producer/consumer pairs on those channels.

RaftLib 7 May 24, 2022
A programming game, in which your goal is to help a group of dwarves establish a small outpost in the middle of a dangerous forest.

"Since they were to come in the days of the power of Melkor, Aulë made the dwarves strong to endure. Therefore they are stone-hard, stubborn, fast in

Alexey Nikolaev 4 Jan 8, 2022
A novel technique to communicate between threads using the standard ETHREAD structure

??️ dearg-thread-ipc-stealth Usage There are two main exported methods, one to read from another thread, and another to serve the content to another t

Lloyd 79 Jun 19, 2022
Simulate Linux Completely Fair Scheduler (CFS) using POSIX Threads

Linux CFS Simulator Simulate Linux Completely Fair Scheduler (CFS) using POSIX Threads. Build and Run $ make $ ./cfs-sim Note: The process status tabl

null 19 May 4, 2022
Minimalistic logging library with threads and manual callstacks

Minimalistic logging library with threads and manual callstacks

Sergey Kosarevsky 21 Jun 24, 2022
An ultra-simple thread pool implementation for running void() functions in multiple worker threads

void_thread_pool.cpp © 2021 Dr Sebastien Sikora. [email protected] Updated 06/11/2021. What is it? void_thread_pool.cpp is an ultra-simple

Seb Sikora 1 Nov 19, 2021
The basics of threading a process. How to make threads. Discovering the mutex.

Dining-Philosopher-Problem! The basics of threading a process. How to make threads. Discovering the mutex. In C.. Решение задачи об обедающих философа

Yuriy Koroliov 1 Jan 10, 2022
Parallel algorithms (quick-sort, merge-sort , enumeration-sort) implemented by p-threads and CUDA

程序运行方式 一、编译程序,进入sort-project(cuda-sort-project),输入命令行 make 程序即可自动编译为可以执行文件sort(cudaSort)。 二、运行可执行程序,输入命令行 ./sort 或 ./cudaSort 三、删除程序 make clean 四、指定线程

Fu-Yun Wang 3 May 30, 2022
Sagan - a multi-threads, high performance log analysis engine

Sagan - Sagan is a multi-threads, high performance log analysis engine. At it's core, Sagan similar to Suricata/Snort but with logs rather than network packets.

Quadrant Information Security 63 Jun 17, 2022
Thread-pool - Thread pool implementation using c++11 threads

Table of Contents Introduction Build instructions Thread pool Queue Submit function Thread worker Usage example Use case#1 Use case#2 Use case#3 Futur

Mariano Trebino 595 Jun 26, 2022