Reading through fread_string, you'll see that it uses the mud's hashed
string space,
plast = top_string + sizeof(char *)
then later updates the top_string pointer,
top_string = plast
The problem to solve is how to add two strings to this space at the same
time. By just locking the function, the flow of the multiple threads will
become just like the single thread and you won't get any benefit at all. I
haven't really thought about it much, but you could consider having a string
space for each of the threads, that gets merged together once all the
loading is completed, or maybe not merged at all, and updated the hash
search algorithm to handle multiple blocks.
----- Original Message -----
From: "Dale Kingston" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 01, 2003 12:49 PM
Subject: Re: Threading question
> Ok another little question, I put in all the locking on things like
skills,
> spells, areas, and commands. To prevent other loading functions that needs
> those from calling them before they are needed.
>
> But when I boot the mud it well crashs nastly. And where it crashs is in
> fread_string. Which now that I think about it makes alot of sence cause
> these 3 threads would be using those functions so I guess my question is
> this. Should I lock those functions? Or is there another way I can have
them
> all work in harmony?
>
>
> --
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
>