Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Dealing with non Thread safe modules

by chorg (Monk)
on Feb 11, 2001 at 22:01 UTC ( #57750=note: print w/replies, xml ) Need Help??


in reply to Re: Dealing with non Thread safe modules
in thread Dealing with non Thread safe modules

3.Allow only one thread at a time to access the library (mutex fr the whole library)

How would one do this? Obviously I am not a thread master, but I have an almost infinite capacity for frustration, which serves me as well as my caffine addiction and my distaste for sleep. However, I really want to work with threads. What is the interface for using ithreads, and where is it documented? Is this different from using Thread.pm?
_______________________________________________
"Intelligence is a tool used achieve goals, however goals are not always chosen wisely..."

  • Comment on Re: Re: Dealing with non Thread safe modules

Replies are listed 'Best First'.
Re: Re: Re: Dealing with non Thread safe modules
by AgentM (Curate) on Feb 12, 2001 at 01:39 UTC
    Good question. In Perl, this is difficult since the Threads.pm muteces are exactly what's holding PerlThreads back in the stone age. I'm working on a fake mutex that uses flock on some file. Read more about the difficulties with flock here. In the meantime, just flock the library or some arbitrary file everytime you wish to access the file. Keep in mind that this defeats any use of threads within that library- only one thread at a time may access it and your thread stacks may expand greatly. I'll keep you posted on my own efforts as well. Good luck!
    AgentM Systems nor Nasca Enterprises nor Bone::Easy nor Macperl is responsible for the comments made by AgentM. Remember, you can build any logical system with NOR.
      Bear with me - I'm almost there...

      When you say flock the library - exactly what do you mean? I am confused...

      BTW, thanks for the help - I'm learning tons today:)
      _______________________________________________
      "Intelligence is a tool used achieve goals, however goals are not always chosen wisely..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-10-04 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?