Files
moby/libnetwork
Cory Snider 94daa36f03 libnetwork: don't reinvent mutexes
The (*Sandbox).joinLeaveStart() and .joinLeaveEnd() methods implement an
exclusive lock which is almost functionally identical to
(*sync.Mutex).Lock() and .Unlock(), respectively. The only notable
differences are that joinLeaveStart allocates, and calling
joinLeaveEnd() more times than joinLeaveStart() is a silent no-op
instead of a fatal error.

The construction of the joinLeaveStart/End methods is shaped like a
condition variable which uses channels for waiting and broadcasting.
The condition being waited for is that the joinLeaveDone struct field is
nil, i.e. that the lock has not been acquired by another goroutine.
As the condition is being checked and set while in a critical section,
it is a mutex implemented in terms of mutexes and channels. Replace the
home-grown mutex with a plain sync.Mutex.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2025-05-26 13:21:20 -04:00
..
2025-05-01 14:16:44 +02:00
2025-02-25 15:24:25 +00:00
2025-04-07 16:56:49 +01:00
2025-05-15 10:00:16 +02:00
2025-05-26 13:21:20 -04:00
2025-05-15 18:24:58 +02:00
2025-05-26 13:21:20 -04:00
2025-04-09 08:45:33 +02:00
2025-04-09 08:45:33 +02:00
2025-04-04 11:21:17 +02:00

libnetwork - networking for containers

Libnetwork provides a native Go implementation for connecting containers

The goal of libnetwork is to deliver a robust Container Network Model that provides a consistent programming interface and the required network abstractions for applications.

Design

Please refer to the design for more information.

Using libnetwork

There are many networking solutions available to suit a broad range of use-cases. libnetwork uses a driver / plugin model to support all of these solutions while abstracting the complexity of the driver implementations by exposing a simple and consistent Network Model to users.

Contributing

Want to hack on libnetwork? Docker's contributions guidelines apply.

Code and documentation copyright 2015 Docker, inc. Code released under the Apache 2.0 license. Docs released under Creative commons.