JuliaGeometry / JuliaGeometry/Triangulate.jl

Thread safety

Open
#17 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
42
Forks
12
PR merge metrics
No merged PRs in 30d

Description

When using the unsuitable callback, the unsuitable method is passed to C through a global variable. Therefore at least in this case, the code is not thread-safe. It should be thread-safe (not tested though) if -u is not used.

For making the code thread-safe, the unsuitable callback should be made part of TriangulateIO in the C library after checking if this is possible withot mayor modification of triangle.c .

Meanwhile the advise is to put a lock around triangulate calls in multithreaded code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading triangle.c and the TriangulateIO definition in the Julia wrapper, focusing on how the unsuitable callback is passed through a global variable and how -u changes that path. Check whether the callback can be moved into TriangulateIO without major changes to triangle.c. Done means the callback path is safe for concurrent triangulate calls, with the -u case and existing lock advice clarified or tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, julia
Domain
api, computer-graphics
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.