A const will copy a new instance of that constant value wherever that name is used, which isn't very helpful for synchronization. You probably want a static instead.
I just need to take pass a Vec<u8> from a FFI boundary to an asynchronous event loop. I want to use an UnboundedSender<Vec<u8>> to achieve this. Since the channel is Send + Sync, wouldn't it be fine to use a static mut sender: Option<UnboundedSender<Vec<u8>> = None?
Option isn’t Sync though. If you set it to Some at the start of the program and pinky swear you won’t remove it then it would work. Alternatively it’s bit safer to initialize it with once_cell or lazy_static and get rid of the Option.
static is a global variable so it has single address on runtime. const purely is a compile time only thing and it works like copy-pasting its initialization expression whenever used.
In addition, const items don't have any guarantee whatsoever of being threadsafe, it fully depends on what the value is within the const. lazy_static on the other hand does provide that guarantee.