Skip to content

Multithreading causes random errors #189

@Shmuley95

Description

@Shmuley95

The minimum working example below should always return 1. When using one thread, everything is fine, but as soon as I run the same code with multiple threads, random errors start creeping up.

using IntervalRootFinding
let
	results = []
	Threads.@threads for iter in 1:1000	
		f(x) = (x^-1)-1
		result = roots(f, 0.0001..10000)
		push!(results, result)
	end
	length(unique(results))
end

I hope you could help identify the issue or find a possible workaround. Thank you for your time!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions