Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Simple reentrant token parser

Author: Dann Corbit

Date: 12:49:31 10/10/05

Go up one level in this thread


On October 10, 2005 at 15:42:46, Gerd Isenberg wrote:
[snip]
>Yes, Dann's routine is reentrant and therefor thread-safe.
>strtok() is not thread-safe, but strtok_r.
>No idea about the protability of the latter.

Yes, that is the basic thrust behind this routine.  It has an interface almost
identical to strtok_r(), except that I have default values for the separator
character set and like strtok_r(), it can be called by multiple threads of
execution.

I do not know if I would call it fully reentrant, because it cannot operate
recursively on the original input string (as it modifies it during execution).

However, it can be used to perform parsing in multiple threads of execution
which was the impetus behind its formation.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.