Thread safety #25

Merged
merged 3 commits into from Mar 31, 2014

Conversation

Projects
None yet
3 participants
@volodg
Contributor

volodg commented May 14, 2012

The pull request contains the fix to use safely the TouchXML with multithreading.

@schwa

This comment has been minimized.

Show comment Hide comment
@schwa

schwa May 14, 2012

Member

I like 095e0c1 but the other two commits are possibly unnecessary. The enumeration commit definitely is unneeded (the block based enumeration isn't magically any better than a for in loop).

If you could redo this pull request with just the thread safety changes I'd be happier to accept it.

Member

schwa commented May 14, 2012

I like 095e0c1 but the other two commits are possibly unnecessary. The enumeration commit definitely is unneeded (the block based enumeration isn't magically any better than a for in loop).

If you could redo this pull request with just the thread safety changes I'd be happier to accept it.

@schwa

This comment has been minimized.

Show comment Hide comment
@schwa

schwa May 14, 2012

Member

Ah - actually I can see the value of the block enum version now…

Member

schwa commented May 14, 2012

Ah - actually I can see the value of the block enum version now…

@dodikk

This comment has been minimized.

Show comment Hide comment
@dodikk

dodikk Jun 11, 2012

The only advantage of "for" loop is backward compatibility with older iOS versions.

However, with the help of our project below you can use block enumeration API even on iOS 3.
https://github.com/EmbeddedSources/BlockRuntime

According to our benchmarks, block version of NSDictionary enumeration is 3X faster than "for" loop
items count : 10 000 000
for -- 8.390 sec
enumerate -- 3.615 sec

Not sure if it's O(N) but it definitely performs better.

dodikk commented Jun 11, 2012

The only advantage of "for" loop is backward compatibility with older iOS versions.

However, with the help of our project below you can use block enumeration API even on iOS 3.
https://github.com/EmbeddedSources/BlockRuntime

According to our benchmarks, block version of NSDictionary enumeration is 3X faster than "for" loop
items count : 10 000 000
for -- 8.390 sec
enumerate -- 3.615 sec

Not sure if it's O(N) but it definitely performs better.

@dodikk

This comment has been minimized.

Show comment Hide comment
@dodikk

dodikk Jun 11, 2012

P.S. What else prevents you from accepting the patch?

dodikk commented Jun 11, 2012

P.S. What else prevents you from accepting the patch?

schwa added a commit that referenced this pull request Mar 31, 2014

@schwa schwa merged commit 7e98b15 into TouchCode:master Mar 31, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment