David Dong

David Dong

Java/C/C#/Python

Java/C/C#/Python

  • posts

  • C# 的 IntPtr 类型

    C# 中,IntPtr 是一个代表内存位置指针的类型。它被用来存储一个变量或一个对象在内存中的地址。IntPtr 是一个整数类型,但它的大小与平台有关。在 32 位系统中,IntPtr 的大小为 32 比特(4字节),在 64 位系统中,它的大小为 64 比特(8字节)。

  • 浅析 C# 中的线程同步

    线程间同步是指在多线程环境下,保证共享资源的安全和一致性的机制。 C# 中提供了多种方式实现线程间同步。例如:

    • lock 语句:使用一个对象作为锁,保证一次只有一个线程可以进入临界区;
    • Interlocked 类:提供了原子操作,如递增、递减、交换和读取值;
    • Monitor 类:提供了锁定对象、等待信号和通知信号的方法;
    • Mutex 类:提供了跨进程的互斥锁,可以用来同步不同进程中的线程;
    • Semaphore 类:提供了一个计数器,限制同时访问共享资源的线程数;
    • AutoResetEvent 和 ManualResetEvent 类:提供了信号量,可以用来通知或等待其他线程的状态变化;
  • Use Pypy to make Python run faster

    “If you want your code to run faster, you should use Pypy.” - Guido van Rossum, the father of Python.
    To understand why Pypy is faster, we should know what makes Python slower.

  • Fixing the issue: Communication error with Jack server (35) when building AOSP

    I met an issue Communication error with Jack server (35) when built the AOSP yesterday. I can build the AOSP successfully before this issue popped up. I spent hours figuring out why and solved the problem.

  • CI platform migration: from Travis CI to GitHub Actions

    I’ve used Travis CI to build and deploy my projects for some years. The performance of Travis CI can meet my requirements. However, recently I found Travis CI stopped working for me. ☹️

  • Speeding up my blog loadtime

    示例图片
    This is the story of how I speed up my blog website load time…

  • C# 线程

    在.NET 应用程序中,都是以 Main () 方法作为入口的,当调用此方法时系统就会自动创建一个主线程

  • A quick way to fix the Gitalk Error: Validation Failed

    I’ve met an error Validation Failed (422) when using Gitalk in my blog. This article records how I fixed this error. If you are in trouble with this issue and you are looking for a solution, reading this article may help you.

  • Build TA images on different TEE

    This article will give an introduction to how to build TA images on different TrustZone.

  • Some useful knowledge for Fingerprint Application on Trusty TEE

    I have completed an Android platform fingerprint application on Trusty TEE recently for my work. This page will try to give some useful information, which is a summary of my work and might be helpful for somebody who wants to bring up a fingerprint application on Trusty TEE.

  • 利用 Microsoft WDK 工具生成数字签名

    看过我这一篇文章 「浅谈数字签名」 的读者应该记得,在这篇文章的末尾遗留了一个问题 — 在windows平台下如何利用Microsoft提供的工具来生成数字签名。我在这篇文章中会对这个问题做一个说明,并引用一个例子来介绍签名的过程。

  • mbedtls 使用说明

    最近的工作中使用到了mbedtls,这里做一个简单的总结。