[Haskell-cafe] MVar which can not be null ?

Alexander V Vershilov alexander.vershilov at gmail.com
Mon Mar 18 08:26:11 CET 2013


If you have only one variable then you can use:
atomicModifyIORef  from IORef it will give you atomic transactions and
IORef will always contains some value.
If you have a list of variables you need to make atomic actions on, then
you may like to use STM.

On 18 March 2013 11:07, s9gf4ult <s9gf4ult at gmail.com> wrote:
> Hello, I am looking for MVar which can not be null. I need some kind of
> thread save atomic IO operation like I can do
> with modifyMVar, but I want this variable always contain some value and
> never be null.
> Thanks.
>

-- 
Alexander



More information about the Haskell-Cafe mailing list