Tag

cgo

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
Nov 25, 2024 · Fundamentals

Understanding SIGPIPE Signal and Preventing Service Crashes in Go‑Rust Integration

This article explains how the Linux SIGPIPE signal is generated during broken TCP connections, why the default kernel handling can terminate Go services that call Rust code via cgo, and provides practical code examples to ignore SIGPIPE and avoid silent process exits.

GoLinux SignalsRust
0 likes · 15 min read
Understanding SIGPIPE Signal and Preventing Service Crashes in Go‑Rust Integration
IT Services Circle
IT Services Circle
May 25, 2024 · Backend Development

Calling Go Functions from C: Implementation Steps and Underlying Mechanism

This article explains how to call Go functions from C within the same process, covering the three‑step implementation, compilation into a shared library, the C invocation code, and a detailed walkthrough of the cgo and Go runtime mechanisms that make cross‑language calls possible.

C++GoRuntime
0 likes · 13 min read
Calling Go Functions from C: Implementation Steps and Underlying Mechanism
Refining Core Development Skills
Refining Core Development Skills
May 23, 2024 · Fundamentals

Calling Go Functions from C: Step‑by‑Step Guide and Underlying Mechanism

This article explains how to invoke Go functions from C within the same process, covering the three‑step implementation, the required cgo compilation commands, the generated intermediate files, and the runtime mechanisms such as crosscall2 and stack switching that make cross‑language calls possible.

C++FFIGo
0 likes · 12 min read
Calling Go Functions from C: Step‑by‑Step Guide and Underlying Mechanism
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Jan 17, 2024 · Artificial Intelligence

Building a License Plate Recognition Service with C++, TensorRT, and Go

This article details how to train a YOLOv8‑pose model for license‑plate detection, convert it to TensorRT engine, implement C++ inference and preprocessing, expose the functionality via CGO to Go, and assemble a lightweight web service for real‑time plate recognition.

C++GoLicense Plate Recognition
0 likes · 12 min read
Building a License Plate Recognition Service with C++, TensorRT, and Go
Shopee Tech Team
Shopee Tech Team
Jun 2, 2022 · Backend Development

Applying GPU Technology for High‑Throughput Image Rendering in Shopee Off‑Platform Ads

The Shopee Off‑Platform Ads team built a GPU‑accelerated Creative Rendering System that uses a four‑layer architecture, CGO‑bridged C/C++ kernels, and template caching to process billions of product images daily, achieving roughly ten‑fold speedup, half the cost, and far reduced rack space while handling high concurrency.

CUDAGPUGo
0 likes · 23 min read
Applying GPU Technology for High‑Throughput Image Rendering in Shopee Off‑Platform Ads
Tencent Cloud Developer
Tencent Cloud Developer
Apr 18, 2022 · Backend Development

Go Black Magic: Accessing Runtime Functions and Integrating C/Assembly for Performance

This article demonstrates three Go black‑magic techniques—using go:linkname to call private runtime functions like memmove and growslice, employing cgo to invoke C code, and embedding Plan 9 assembly—to bypass safety checks and achieve significant performance improvements, though they rely on unsafe practices.

GoRuntimeUnsafe
0 likes · 17 min read
Go Black Magic: Accessing Runtime Functions and Integrating C/Assembly for Performance
Sohu Tech Products
Sohu Tech Products
Apr 13, 2022 · Backend Development

Understanding Go Memory Leaks and Using pprof for Profiling

This article explains why Go programs can still exhibit memory growth despite automatic garbage collection, describes how to identify and diagnose such issues with the built‑in pprof tool, and details the underlying sampling mechanism, memory fragmentation, and cgo‑related allocations.

GCGoMemory Leak
0 likes · 9 min read
Understanding Go Memory Leaks and Using pprof for Profiling
php中文网 Courses
php中文网 Courses
Mar 28, 2022 · Backend Development

Implementing PHP Extensions with Zephir, CGO, and JIT: A Performance Comparison

This article explores several methods for creating PHP extensions—including native C, Zephir, php-cpp, php-x, and CGO—provides sample code, describes compilation steps, and compares their execution speed using a Fibonacci benchmark with and without PHP JIT.

JITbackendcgo
0 likes · 6 min read
Implementing PHP Extensions with Zephir, CGO, and JIT: A Performance Comparison
Tencent Cloud Developer
Tencent Cloud Developer
Feb 10, 2022 · Backend Development

Understanding CGO: Usage, Mechanisms, and Best Practices in Go

CGO lets Go programs call C functions and vice versa by importing "C", generating intermediate files, handling type conversion, managing runtime transitions, and requiring careful memory and pointer handling, with best‑practice guidelines to avoid leaks, scheduler issues, and thread explosion.

C InteroperabilityGoRuntime
0 likes · 33 min read
Understanding CGO: Usage, Mechanisms, and Best Practices in Go
Tencent Cloud Developer
Tencent Cloud Developer
Aug 30, 2021 · Backend Development

Troubleshooting Golang Memory Leaks: A Production Case Study

The case study walks through debugging a Go production service that regularly spiked to over 6 GB of resident memory, revealing that unbuffered channel leaks, mis‑configured HTTP client timeouts, and ultimately a cgo‑based image‑processing library spawning unmanaged threads caused the leaks, and outlines a systematic troubleshooting workflow.

Memory Leakcgodebugging
0 likes · 12 min read
Troubleshooting Golang Memory Leaks: A Production Case Study
Tencent Cloud Developer
Tencent Cloud Developer
Aug 23, 2021 · Backend Development

Performance Optimization Techniques for Go Standard Library

The article surveys a range of Go standard‑library performance tricks—from using sync.Pool and zero‑copy string/byte conversions to reducing lock contention, leveraging go:linkname, caching call‑frame data, optimizing cgo calls, employing custom epoll, SIMD, and occasional JIT—while urging profiling‑first, readability‑preserving optimizations.

Gobenchmarkcgo
0 likes · 17 min read
Performance Optimization Techniques for Go Standard Library