Is Logger thread safe?

Discussion in 'Ruby' started by Iñaki Baz Castillo, Jun 29, 2008.

  1. Hi, in my program I use threads and a Logger instante accessible from any=20
    thread. Must I do something to make the Logger thread safe?

    I've looked at the Logger code and it seems that it uses Mutex in some meth=
    ods=20
    and does a:
    require 'monitor'

    Is then Logger class thread safe and I can call its methods (@logger.debug.=
    =2E.)=20
    from any thread in parallel safely?

    Thanks.

    =2D-=20
    I=C3=B1aki Baz Castillo
    Iñaki Baz Castillo, Jun 29, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sachin
    Replies:
    1
    Views:
    963
    Soren Kuula
    Feb 3, 2006
  2. Gabriel Rossetti
    Replies:
    0
    Views:
    1,313
    Gabriel Rossetti
    Aug 29, 2008
  3. cap
    Replies:
    3
    Views:
    282
    James Edward Gray II
    Dec 11, 2005
  4. Georges Ko
    Replies:
    4
    Views:
    266
    Georges Ko
    Jul 26, 2006
  5. John Nagle
    Replies:
    5
    Views:
    466
    John Nagle
    Mar 12, 2012
Loading...

Share This Page