interprocess-0.2.1.0: Shared memory and control structures for IPC
Safe HaskellNone
LanguageHaskell2010

Foreign.SharedObjectName

Description

Globally unique names to be used as references in the interprocess communication.

The implementation must guarantee that no two processes can generate the same unique SOName independently at the same time. To ensure this, the implementation uses three different seeds:

  1. C rand() with a time-dependent seed srand(time(NULL))
  2. Process id taken from getpid or GetCurrentProcessId (unique across process).
  3. A global auto-incremented variable (unique within a process).
Synopsis

Documentation

data SOName a Source #

Reference to a shared object; can be sent to other processes.

Instances

Instances details
Eq (SOName a) Source # 
Instance details

Defined in Foreign.SharedObjectName.Internal

Methods

(==) :: SOName a -> SOName a -> Bool #

(/=) :: SOName a -> SOName a -> Bool #

Ord (SOName a) Source # 
Instance details

Defined in Foreign.SharedObjectName.Internal

Methods

compare :: SOName a -> SOName a -> Ordering #

(<) :: SOName a -> SOName a -> Bool #

(<=) :: SOName a -> SOName a -> Bool #

(>) :: SOName a -> SOName a -> Bool #

(>=) :: SOName a -> SOName a -> Bool #

max :: SOName a -> SOName a -> SOName a #

min :: SOName a -> SOName a -> SOName a #

Read (SOName a) Source # 
Instance details

Defined in Foreign.SharedObjectName.Internal

Show (SOName a) Source # 
Instance details

Defined in Foreign.SharedObjectName.Internal

Methods

showsPrec :: Int -> SOName a -> ShowS #

show :: SOName a -> String #

showList :: [SOName a] -> ShowS #

Storable (SOName a) Source # 
Instance details

Defined in Foreign.SharedObjectName.Internal

Methods

sizeOf :: SOName a -> Int #

alignment :: SOName a -> Int #

peekElemOff :: Ptr (SOName a) -> Int -> IO (SOName a) #

pokeElemOff :: Ptr (SOName a) -> Int -> SOName a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (SOName a) #

pokeByteOff :: Ptr b -> Int -> SOName a -> IO () #

peek :: Ptr (SOName a) -> IO (SOName a) #

poke :: Ptr (SOName a) -> SOName a -> IO () #

hPutSOName :: Handle -> SOName a -> IO () Source #

Write a shared object name into somwhere referenced by a handle. Useful for sending references to other processes via pipes.

hGetSOName :: Handle -> IO (Maybe (SOName a)) Source #

Read a shared object name from somwhere referenced by a handle. Returns Nothing if hGetBuf gets less than 32 bytes. Useful for sending references to other processes via pipes.

unsafeWithSOName :: SOName a -> (CString -> IO b) -> IO b Source #

Use a pointer to a C string to pass to some low-level (e.g. foreign) functions. SOName is asserted immutable, so do not modify it!