10.3.1 Message queues
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Multithreaded applications
        • Thread communication
          • Message queues
            • thread_send_message/2
            • thread_send_message/3
            • thread_get_message/1
            • thread_peek_message/1
            • message_queue_create/1
            • message_queue_create/2
            • message_queue_destroy/1
            • thread_get_message/2
            • thread_get_message/3
            • thread_peek_message/2
            • message_queue_property/2
            • message_queue_set/2
    • Packages
Availability:built-in
[semidet]thread_send_message(+Queue, +Term, +Options)
As thread_send_message/2, but providing additional Options. These are to deal with the case that the queue has a finite maximum size and is full: whereas thread_send_message/2 will block until the queue has drained sufficiently to accept a new message, thread_send_message/3 can accept a time-out or deadline analogously to thread_get_message/3. The options are:
deadline(+AbsTime)
The call fails (silently) if no space has become available before AbsTime. See get_time/1 for the representation of absolute time. If AbsTime is earlier then the current time, thread_send_message/3 fails immediately. Both resolution and maximum wait time is platform-dependent.198The implementation uses MsgWaitForMultipleObjects() on MS-Windows and pthread_cond_timedwait() on other systems.
timeout(+Time)
Time is a float or integer and specifies the maximum time to wait in seconds. This is a relative-time version of the deadline option. If both options are provided, the earlier time is effective.

If Time is 0 or 0.0, thread_send_message/3 examines the queue and sends the message if space is available, but does not suspend if no space is available, failing immediately instead.

If Time < 0, thread_send_message/3 fails immediately without sending the message.