Difference between a “coroutine” and a “thread”?

First read: Concurrency vs Parallelism – What is the difference? Concurrency is the separation of tasks to provide interleaved execution. Parallelism is the simultaneous execution of multiple pieces of work in order to increase speed. —https://github.com/servo/servo/wiki/Design Short answer: With threads, the operating system switches running threads preemptively according to its scheduler, which is an algorithm … Read more

dma vs interrupt-driven i/o

I’m a little unclear on differences between DMA and interrupt I/O Differences between DMA and interrupts are bogus because they are not opposing concepts. DMA and interrupts are orthogonal concepts, and both concepts are typically used together. The alternative to DMA is programmed I/O, aka PIO. The alternative to interrupts is polling. Interrupt-driven You need … Read more

Best way to store Badge criteria?

Rules. You create events in the system, and use rules within an event stream processor. Specifically, say you have a badge “made 10 posts”. You don’t run “select count(*) from posts where user = :user” for every post. Rather, you have a simple rule that watches each post come by, and “count them”, storing the … Read more

Microservices – best practices to retrieve the related data to specific user from the other micro services with the minimal memory/time loss

Let’s say you have services: MS1, MS2, MS3, MS4. The web app / mobile app hits MS1 for information. Now MS1 needs to return a response containing data that are managed by MS2, MS3 and MS4. Poor Solution – MS1 calls MS2, MS3 and MS4 to retrieve information, aggregates them and returns the final aggregated … Read more